Missing Condition

  • 0

    So I think another condition that needs to be added is that there must exist a number no greater than k.
    Otherwise, the only solution is empty matrix, however area must > 0.
    Consider this test case: [[2]] 1
    It returns -2147483648 on mine because my max variable is default min value of Integer. It returns -1000000000 as the expected answer. (so problem creator used -1000000000 as default result? : ) )

  • 0

    Agreed. The corner case is that the minimal sum is larger than k, and output of this case should be clarified in the problem statement.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.