The difference between i and j is ambiguous

  • 0

    I found the difference between nums[i] and nums[j] can be negative in the problem Contains Duplicate III. So if the difference between i and j can be negative, the result will be really different in this problem.

    [1, 0, 1]

    results in answer true because 0 - 2 = -2 < 1?

    The difference between i and j should be restricted to be non-negative.

  • 0

    Another explanation:

    The bound can be negative but the difference is regarded to be non-negative?

Log in to reply

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