Count unordered index pairs with absolute difference exactly K using frequency maps.
Constraints
Example
```python >>> count_pairs_with_diff([1, 5, 3, 4, 2], 2) 3 >>> count_pairs_with_diff([1, 1, 1], 0) 3 >>> count_pairs_with_diff([1, 1, 2, 2, 3, 3], 1) 8 >>> count_pairs_with_diff([], 3) 0 ```
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints