Should the problem statement be updated to indicate that the indices must be distinct?


  • 0
    E

    When I ran the "Check Submission", I failed the following test case:

    Input: nums=[3, 2, 4], target=6

    Expected: [1,2]

    However, another valid solution is [0,0], as nums[0] + nums[0] = 6.

    Either the problem statement should be updated to explicitly state that the indices should be distinct, or this test case should be changed.

    Thanks!


Log in to reply
 

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