I see that the Contains Duplicate has a test case which is incorrect:

[99,99]

2

Also they have test case like this:

[-1,-1]

1

which I feel is contradictory.

The problem states that we need to find two indices i and j such that nums[i] == nums[j] and the absolute difference is (i - j) == k

When there are two elements in the array the absolute difference can be only 1. How can it be both 1 and 2.

I don't know whether i am missing something here.