Is this test case wrong?


  • 0
    D

    hi all,

    Do you have this case? And I think below case is wrong!!

    Input:
    11, [1,2,3,4,5]
    Output:
    0
    Expected:
    3


  • 0
    A

    3 + 4 + 5 > 11

    Your code may ignore to adjust left pointer, so when it adjust right pointer to 5, you code just break out and return 5. Actually you can reset your left pointer forward to 3


Log in to reply
 

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