Count Fair Pairs

Given a 0-indexed integer array nums and two integers lower and upper, count the number of pairs (i, j) with i < j such that lower <= nums[i] + nums[j] <= upper.

Examples
Input: [[0,1,4,4,5,7],3,6]
Output: 6
Hints

Count Fair Pairs

Given a 0-indexed integer array nums and two integers lower and upper, count the number of pairs (i, j) with i < j such that lower <= nums[i] + nums[j] <= upper.