0% completed
You are given an array nums
containing n
integers and a 2D array queries
of length q
, where queries[i] = [start<sub>i</sub>, end<sub>i</sub>], representing a starting and ending range (inclusive).
Return an array of size q
, where each element is the minimum
value in the respective range from nums
.
Example 1:
[0, 3]
, the minimum is 1
.[2, 5]
, the minimum is 1
.[0, 1]
, the minimum is 2
.[3, 7]
, the minimum is 3
.[0, 7]
, the minimum is 1
.[4, 6]
, the minimum is 3
.[4, 5]
, the minimum is 5
.Example 2:
[1, 3]
, the minimum is 2
.[0, 2]
, the minimum is 4
.[2, 4]
, the minimum is 2
.[3, 5]
, the minimum is 2
.Example 3:
[0, 4]
, the minimum is 5
.[1, 3]
, the minimum is 5
.[2, 5]
, the minimum is 5
.[3, 6]
, the minimum is 7
.Constraints:
Try solving this question here:
.....
.....
.....