Given an integer array nums, handle multiple queries of the following 2 types:
- Given a value x, update all elements inside nums that are less than x to x
- Given an index i and a value v , modify nums[i] to v
Return nums after running through all queries.
Example
Input
nums:
[1,2,3,4,5]
queries:
[[1,3,-1],[2,0,1],[1,4,-1]]
After first query, nums become : [3,3,3,4,5]
Explanation : [1,3,-1] refers to type 1 so update all numbers in nums that are less than 3 to 3
After second query, nums become : [1,3,3,4,5]
Explanation : [2,0,1] refers to type 2 so modify nums[0] to 1
After third query, nums become : [4,4,4,4,5]
Explanation : [1,4,-1] refers to type 1 so update all numbers in nums that are less than 4 to 4
Output
Return
[4,4,4,4,5]
Constraints
1 <= n <= 10^6, n = length of nums
1 <= m <= 10^6, m = length of queries