Count Pairs Less Than Target

Given an integer array nums and an integer target, return the number of index pairs (i, j) such that i < j and nums[i] + nums[j] < target.

Given an integer array `nums` and an integer `target`, return the number of index pairs `(i, j)` such that `i < j` and `nums[i] + nums[j] < target`.

- `2 <= nums.length <= 100` - `-10^9 <= nums[i], target <= 10^9` - The interactive visualizer accepts at most 12 values; longer valid arrays are execution-only.

Example 1: input nums = [3,0,2,1], target = 4; output 4. The qualifying pairs are (0,1), (1,2), (1,3), and (2,3).

Example 2: input nums = [5,6,7], target = 4; output 0. Every pair sum is at least 11.

Category: Two Pointers. Topic: two-pointers. Difficulty: Easy. Patterns: two-pointers, sorting.