problem with description
The question that is being checked for is not the question that is being asked.\n\nThe question being checked for seems to be:\n\nGiven an array of integers num
The question that is being checked for is not the question that is being asked.\n\nThe question being checked for seems to be:\n\n*Given an array of integers nums and an integer k, return the number of unique pairs that are of the form (nums[i], nums[j]) where*\n**nums[i] <= nums[j]\ni != j\nabs(nums[i] - nums[j]) == k**\n\nThe question that is being asked is similar but different:\n\n*Given an array of integers nums and an integer k, return the number of unique pairs that are of the form (nums[i], nums[j]) where*\n**i < j\nabs(nums[i] - nums[j]) == k**\n\nFor all of the examples in the problem description, the two questions give the same answer. Buf for the test case\n```\n[0,3,0]\n3\n```\nthe expected solution is 1, while the answer should be 2, given the actual problem description.\n\nThe pairs for the actual question are (0, 3) and (3, 0)\nThe pair for the checked for question is (0, 3)\n\nFWIW, here\'s a quadratic time brute force literal interpretation of the problem description that gets 2.\n```\nclass Solution:\n    def findPairs(self, nums: List[int], k: int) -> int:\n        n = len(nums)\n        k_diff_pairs = []\n        for i in range(n):\n            for j in range(n):\n                if i < j:\n                    if abs(nums[i] - nums[j]) == k:\n                        k_diff_pairs.append((nums[i], nums[j]))\n        return len(frozenset(k_diff_pairs))\n```\nAnd here\'s an O(n) time solution\n```\nclass Solution:\n    def findPairs(self, nums: List[int], k: int) -> int:\n        count = 0\n        so_far = dict()\n        for num in nums:\n            for x in (num - k, num + k):\n                if x in so_far:\n                    if num not in so_far[x]:\n                        count += 1\n                        so_far[x].append(num)\n            if num not in so_far:\n                so_far[num] = []\n        return count\n```\nPlease consider updating the problem statement and adding the above test case to the examples.\n\nNote that the above test example is a simplified version of one of the tests used to check a solution, namely\n```\n[1,2,4,4,3,3,0,9,2,3]\n3\n```
[]