0985. Sum of Even Numbers After Queries
https://leetcode.com/problems/sum-of-even-numbers-after-queries
Description
You are given an integer array nums
and an array queries
where queries[i] = [vali, indexi]
.
For each query i
, first, apply nums[indexi] = nums[indexi] + vali
, then print the sum of the even values of nums
.
Return an integer array answer
where answer[i]
is the answer to the ith
query.
Example 1:
Example 2:
Constraints:
1 <= nums.length <= 104
-104 <= nums[i] <= 104
1 <= queries.length <= 104
-104 <= vali <= 104
0 <= indexi < nums.length
ac
Last updated