sorted_nums is sorted in increasing order. Each query is [lo, hi] (with lo <= hi). For every query, return how many numbers v in sorted_nums satisfy lo <= v <= hi. Return the answers in query order.
Example 1
Input:
count_in_range([1, 3, 3, 5, 8], [[3, 5], [0, 0], [2, 9]])
Output:
[3, 0, 4]
The values 3, 3, 5 are inside [3, 5]; nothing is 0; 3, 3, 5, 8 are inside [2, 9].
Example 2
Input:
count_in_range([], [[0, 10]])
Output:
[0]
0 <= len(sorted_nums) <= 2 * 10**50 <= len(queries) <= 2 * 10**50 <= sorted_nums[i], lo, hi <= 10**6No results yet
Run your code to check it against the examples, or submit to run every test.