You are given an integer array nums, an initial base integer p, and a queries where each queries[i] = [val_i, k_i].
Process each query queries.length
Append val_i to nums.
Find the k_ith largest element in the updated array nums, denoted as
Update p to
Return an array containing the value of p after each query is processed.
Constraints:
nums.length
nums[i]
p
queries.length
val_i
k_i nums.length
k_i k_{i - 1}
You are given an integer array nums, an initial base integer p, and a queries where each queries[i] = [val_i, k_i].
Process each query queries.length
Append val_i to nums.
Find the k_ith largest element in the updated array nums, denoted as
Update p to
Return an array containing the value of p after each query is processed.
Constraints:
nums.length
nums[i]
p
queries.length
val_i
k_i nums.length
k_i k_{i - 1}