1 <= nums.length <= 10⁵
-10⁴ <= nums[i] <= 10⁴
k is in the range [1, the number of distinct elements in the array].
It is guaranteed that the answer is unique.
O(n)