Kadane Algorithm calculates the subrectangle, out of a bigger rectangle, which yiels the maximum sum in O(n^3).
If you find any bugs, please contact me to joao | DOT | carreira | AT | ist | DOT | utl | DOT | pt