Fastest solution and Editorial solution giving different answer for 3 3 1 2 3 0 -1 -1 1 2 3


#1

fastest solution is wrong.

   for(int i=1;i<m;i++)
   {
      if(A[0][i]>A[0][i-1])
      dp[0][i]=1+dp[0][i-1];
   }
   for(int i=1;i<n;i++)
   {
      if(A[i][0]>A[i-1][0])
      dp[i][0]=1+dp[i-1][0];
   }

missing else break; condition after if.