You are given a 2D integer array `intervals` and a 1D integer array `queries`. The answer to the `j`th query is the size of the smallest interval `i` such that `intervals[i][0] <= queries[j] <= intervals[i][1]`. Return an array containing the answers to the queries.
Offline Query Processing + Min-Heap
Sort queries and process them in order. For each query, add all intervals that start ≤ query to a min-heap keyed by size. Pop intervals whose right end < query (expired). The heap top is the answer.