public static long arrayManipulation2(int n, int[][] queries) { Ranges ranges = new Ranges(n); for (int i = 0; i < queries.Length; i++) { int[] query = queries[i]; int a = query[0] - 1; int b = query[1] - 1; int k = query[2]; ranges.DoOperation(a, b, k); } return(ranges.maxValue); }