You are given an integer array nums and an array of queries queries, where each queries[i] is a pair [val_i, index_i].
For each query queries[i], apply the update nums[index_i] = nums[index_i] + val_i. After modifying nums, compute the sum of all even values currently present in the array.
Return an integer array representing the sum of even numbers after applying each query sequentially.
Constraints:
nums.length
nums[i]
queries.length
val_i
index_i nums.length
You are given an integer array nums and an array of queries queries, where each queries[i] is a pair [val_i, index_i].
For each query queries[i], apply the update nums[index_i] = nums[index_i] + val_i. After modifying nums, compute the sum of all even values currently present in the array.
Return an integer array representing the sum of even numbers after applying each query sequentially.
Constraints:
nums.length
nums[i]
queries.length
val_i
index_i nums.length