Given a static array nums, return the minimum value for each queried interval. Range minimum queries are one of the classic use cases for segment trees and sparse tables when the underlying array does not change.
nums = static integer array, queries = range minimum requests
minimum for each query, in order
Example 1:
Input:
nums = [5,2,6,3,1] queries = [[0,2],[2,4]]
Output:
[2,1]
Explanation:
The minimum in the first interval is 2, and the minimum in the second interval is 1.
Example 2:
Input:
nums = [9,8,7,6] queries = [[1,3]]
Output:
[6]
Explanation:
The smallest value in nums[1..3] is 6.