Problem 2364 · Medium
Good pairs share the same nums[i] minus i, so count each key and subtract the same-key pairs from all pairs.
Open the interactive visualisation