Question DSA-TP-0057
MediumCounting pairs with difference exactly k in a sorted array of distinct numbers: what is the time with two pointers?
- A.
O(n²)
- B.
O(n log n) after sorting only
- C.
Sign up free to see the answer and a step-by-step explanation.