Missing Condition


  • 0
    F

    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
    C

    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.
    input:
    [[1,1],[0,3]]
    -2
    return:
    -1000000000


Log in to reply
 

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