On this day, as we celebrate historical breakthroughs and clever problem-solving, your task is to use hashmap techniques to solve the following challenge:
Given an array of integers and an integer k, write a function to determine the number of unique pairs in the array that have an absolute difference equal to k.
Details:
Example:
For array = [3, 1, 4, 1, 5]
and k = 2
, there are two pairs: (1, 3) and (3, 5).
Input:
Output:
Function Signature Example (Python):
def count_pair_difference(nums: List[int], k: int) -> int:
# Your code goes here
Use hashmap techniques to achieve an efficient solution.