You are viewing a single comment's thread. Return to all comments →
why have u assigned maxsum=-1000 ? can u elobarate
the inputs also given in negitive....
The constraints given say that any element in the array will be at least -9 and be at most 9. The smallest hourglass sum will be -9*7 = -63. So in this case, you just need to initialize max sum to be any value <= -63.