title: What is wrong with my code in finding the length of Maximum Bitonic Subarray
body: <p>Logic used is simple if a triplet x,y,z occurs such that x&gt;y&lt;z then give the length of the array to m and continue and it gives right output in all the test cases I can think of</p>
  <pre><code>#include&lt;iostream&gt;
  #include&lt;algorithm&gt;
  using namespace std;
  int main() 
  {
   int t;
   cin&gt;&gt;t;
   while(t--)
   {
       int n;
       cin&gt;&gt;n;
       int a[n];
       for(int i=0;i&lt;n;i++)
       {
        cin&gt;&gt;a[i];
       }
       int l=0;
       int m=0;
       for(int i=0;i&lt;n;i++)
       {
           l++;
           if(i&gt;0&amp;&amp;i&lt;n-1)
           {
           if(a[i]&lt;a[i-1]&amp;&amp;a[i]&lt;a[i+1])
           {
               l=1;
           }
           }
           if(m&lt;l)
           m=l;
       }
       if(m)
       cout&lt;&lt;m&lt;&lt;endl;
       else 
       cout&lt;&lt;l&lt;&lt;endl;
   }
      return 0;
  }
  </code></pre>