You are viewing a single comment's thread. Return to all comments →
It's worth noting that the description clearly states that the input will be -9 <= R <= 9.
This means that the smallest possible value will be -9*7 (as there are 7 elements in an hourglass). So one can just initialize the max value to -63 :)
In case the constraints are not there, use Integer.MIN_VALUE.
yes it worked. thanks
This is were I messed up, I initialized max value to -9. Thanks, didn't relize were I messed up at until reading your comment.