Point coverage count

Write codeEasy10 min

Your task

Given a list of closed integer intervals [start, end] and a query point q, return how many intervals contain q, that is, satisfy start <= q <= end. Bounds may be negative. Example: intervals [[1,4],[2,2],[5,9]] with q = 2 gives 2.

Examples

count_containing(intervals: list[list[int]], q: int) -> int
Example 1
Inputcount_containing([[1, 4], [2, 2], [5, 9]], 2)
Output2