I found a bug in custom testcase


  • 0
    L

    input[2,3]

    my answer is 1

    expected answei is 2

    WTF?


  • 0

    The problem already points it out that the length of the array will be n while the integer in the array will range from [0, n] inclusive, so in your case the length of the array is 2 then the n will be 2 which is also the biggest but your test case contains 3 which is kind of 'overflow', bigger than the valid biggest 2. So the result can be unexpected.


  • 0
    L

    cool, i get it


Log in to reply
 

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