leetcode985】的更多相关文章

We have an array A of integers, and an array queries of queries. For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index].  Then, the answer to the i-th query is the sum of the even values of A. (Here, the given index = q…
import sys class Solution: def sumEvenAfterQueries(self, A: 'List[int]', queries: 'List[List[int]]') -> 'List[int]': result = list() len0 = len(A) len1 = len(queries) len2 = len(queries[0]) sums = sys.maxsize for i in range(len1): #print(i) val = que…