Count Number of Pairs With Absolute Difference K
Given an integer array nums and an integer k, return the number of pairs (i, j) where i < j such that |nums[i] - nums[j]| == k.
The value of |x| is defined as:
x if x >= 0.
-x if x < 0.
LeetCode Problem - 2006
class Solution {
// Function to ...
perfinsights.hashnode.dev1 min read