Given an array of integers and an integer $K$, count the number of distinct pairs $(a, b)$ such that the absolute difference between $a$ and $b$ is exactly $K$. A pair $(a, b)$ is considered the same…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.