6 views
# LC2922 Count Number of Bad Pairs Practice note for coding interviews. A pair is bad when j-i != nums[j]-nums[i]. Rewrite as nums[i]-i != nums[j]-j and count total pairs minus good pairs with a frequency map. Time complexity is typically linear or n log n after compression; mention edge cases (empty input, all equal, single element) in the interview. I used [Linkjob AI](https://www.linkjob.ai/) while rehearsing this pattern aloud. Disclosure: personal study notes mentioning a practice tool.