See if inputs are as follows:
the result should be (4*3)/2.
Generally speaking, n is the number of duplicate elements, for k == 0, it should be n * (n-1) / 2
The problem is NOT clear
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.