0 x y
1 x y
2 x y
The first line of the test case contains a single integer ‘N’ denoting the size of the ‘arr’ array.
The second line of each test case contains ‘N’ space-separated integers denoting the elements array ‘arr’.
The third line of each test case contains an integer ‘q’ denoting the number of queries.
The next ‘q’ lines of each test case contain 3 space-separated integers denoting the following:
0 x y - modify the number at index x to y.
1 x y - count the number of even numbers in range x to y inclusive.
2 x y - count the number of odd numbers in range x to y inclusive.
For each query, print an integer denoting the answer.
The output of each query will be printed in a separate line.
1 <= N, Q <= 10^5
0 <= l <= r <= N - 1
0 <= arr[i] <= 10 ^ 9
1 <= x <= N
0 <= y <= 10 ^ 9
Where 'arr[i]' denotes the 'ith' element of arr.
Time limit: 1 sec
You do not need to print anything, it has already been taken care of. Just implement the given function.
Ninja Land
Ninja Land
Ninja Land
Sum of Shadows
Chocolate and Sweetness
Chocolate and Sweetness
Range Minimum Query
Ninja and Tree