Queries to calculate sum by alternating signs of array elements in a given range
Given an array arr[] of size N and a 2D array Q[][], consisting of queries of the following two types: 1 X Val: Update arr[X] = Val.2 L R: Find the sum of array elements with alternating signs in the range [L, R]. Examples: Input: arr[] = { 1, 2, 3, 4 }, Q[][] = { { 2, 0, 3 }, { 1, 1, 5 }, { 2, 1, 2