This week's book giveaway is in the JDBC forum. We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line! See this thread for details.

For each combination of upper left and lower right corners { // O(N^4) Calculate the sum; // O(N^2) If the new sum is greater than old maximum, remember it. }

A question very similar to this in one dimension has an O(N) solution. That makes me think there must be an O(N^2) one for this. [ October 15, 2007: Message edited by: Ryan McGuire ]