what about full negative matrix,is it a Case?
They didn't mention that, but i think we should handle this case by getting the area that has the maximum sum which will be the smallest negative elementonly.
-11 -2 -12
-2 -1 -3
1 1 1 1
I am not sure, but I think this assumption makes sense.
if all the matrix is negative you can assume that the maximum sum is zero
and the coordinators of x, y are (-1,-1)(-1,-1)
negative matrix is to most simple case, just return the smallest negativ number index(x0 xx1 y0 y1).
can we make assumptions for our solution? or there isstandard solution for this case?
I hope everybody knows that -1 > -2, making -1 the largest negative integer.
mihaio - good point !
-1 is the largest negative number we can return it in case all the matrix is negative, if the matrix has a zero which is considered neither negative nor positive then we can return the zero as the largest integer or the -1 and both are correct as discussed by some algorithms
I agree with that