I want easy algorithm with minimum order to get the sub-rectangle with the largest sum in an array
for example
array as a input
0 -2 -7 0
9 2 -6 2
-4 1 -4 1
-1 8 0 -2

sub-rectangle
9 2
-4 1
-1 8

maximum sum of its sub-rectangle is : 30

Please I want the idea of this problem beacuse I think too much but I didn't reach to nothing

After thinking long, I found that this sub-rectangle may be include the largest positive number in array but what's the solution if in this sub-rectangle may include negative numbers the maximum of it may largest than the Positive numbers in this sub-rectangle .
thanks,

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by eman 22

sub-rectangle
9 2
-4 1
-1 8

maximum sum of its sub-rectangle is : 30

Please explain how you get the sum of 30 from these 6 numbers.
Normal math gives me 15.

I'm so sorry the maximum sum is 15.

Only post in one forum. Preferably, the correct one... like CS if you need help with an algorithm. Multiple posts means no more help from me.

ok , I don't make it again

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.