Count Pairs Whose Sum is Less than Target
Sort the values, then move two pointers inward; when a pair is small enough, every index between them pairs with the left end.
Sort the values, then move two pointers inward; when a pair is small enough, every index between them pairs with the left end.