package leetcode;

/**
 * https://leetcode.com/problems/sum-of-even-numbers-after-queries/
 */
public class Problem985 {
    public int[] sumEvenAfterQueries(int[] A, int[][] queries) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem985 prob = new Problem985();
        System.out.println(prob.sumEvenAfterQueries(new int[]{1, 2, 3, 4}, new int[][]{
            {1, 0}, {-3, 1}, {-4, 0}, {2, 3}
        })); // [8,6,2,4]
    }
}

@@ -12,16 +12,42 @@
 tcode;%0A%0A
+import java.util.Arrays;%0A%0A
 /**%0A * h
@@ -217,35 +217,409 @@
     
-// TODO%0A        return null
+int%5B%5D answer = new int%5BA.length%5D;%0A        for (int i = 0; i %3C queries.length; i++) %7B%0A            int val = queries%5Bi%5D%5B0%5D;%0A            int index = queries%5Bi%5D%5B1%5D;%0A            A%5Bindex%5D += val;%0A            int sum = 0;%0A            for (int a : A) %7B%0A                if (a %25 2 == 0) %7B%0A                    sum += a;%0A                %7D%0A            %7D%0A            answer%5Bi%5D = sum;%0A        %7D%0A        return answer
 ;%0A  
@@ -739,16 +739,32 @@
 println(
+Arrays.toString(
 prob.sum
@@ -872,16 +872,17 @@
      %7D))
+)
 ; // %5B8,

Update problem 985