• + 0 comments

    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.