An element in an array is called a peak if it is strictly greater than its adjacent left and right neighbors.
You are given an integer array nums and a 2D integer array queries.
Process each query in queries, which can be one of the following two types:
nums[l_i..r_i].
nums[index_i] to val_i.
Return an array containing the results of all type 1 queries in the order they are processed.
Note: The first and last elements of any subarray are not considered peaks.
Constraints:
nums.length
nums[i]
queries.length
queries[i][0] queries[i][0]
For all i such that queries[i][0] queries[i][1] queries[i][2] nums.length
For all i such that queries[i][0] queries[i][1] nums.length queries[i][2]
An element in an array is called a peak if it is strictly greater than its adjacent left and right neighbors.
You are given an integer array nums and a 2D integer array queries.
Process each query in queries, which can be one of the following two types:
nums[l_i..r_i].
nums[index_i] to val_i.
Return an array containing the results of all type 1 queries in the order they are processed.
Note: The first and last elements of any subarray are not considered peaks.
Constraints:
nums.length
nums[i]
queries.length
queries[i][0] queries[i][0]
For all i such that queries[i][0] queries[i][1] queries[i][2] nums.length
For all i such that queries[i][0] queries[i][1] nums.length queries[i][2]