You are given a 2D integer array intervals where intervals[i] = [left_i, right_i] describes an interval from left_i to right_i (inclusive). The size of an interval is right_i - left_i + 1.
You are also given an integer array queries. For each query q, find the size of the smallest interval that contains q (i.e., left_i <= q <= right_i). If no such interval exists, the answer for that query is -1.
Return an array of answers for each query in the original query order.
Input: intervals = [[1,4],[2,4],[3,6],[4,4]], queries = [2,3,4,5] Output: [3,3,1,4] Explanation: Query 2 -> [2,4] (size 3) is the smallest interval containing 2. Query 3 -> [2,4] (size 3) is the smallest interval containing 3. Query 4 -> [4,4] (size 1) is the smallest interval containing 4. Query 5 -> [3,6] (size 4) is the smallest interval containing 5.
Input: intervals = [[2,3],[2,5],[1,8],[20,25]], queries = [2,19,5,22] Output: [2,-1,4,6] Explanation: Query 2 -> [2,3] (size 2) is the smallest containing 2. Query 19 -> no interval contains 19, answer is -1. Query 5 -> [2,5] (size 4) is the smallest containing 5. Query 22 -> [20,25] (size 6) is the smallest containing 22.
1 <= intervals.length <= 10^51 <= left_i <= right_i <= 10^71 <= queries.length <= 10^51 <= queries[j] <= 10^7intervals = [[1, 4], [2, 4], [3, 6], [4, 4]], queries = [2, 3, 4, 5]