Company: Zomato
Difficulty: medium
XOR Operation Problem Description Given an array A consisting of N integers. Also given Q queries along with it. In each query, you are given 3 spaced separated integers L, R and X . You need to output the summation of XOR of X with each of the array elements from range L to R both inclusive (1- based indexing). The array does not change after any query. Input The first line contains two integers N and Q . The next line contains N spaced separated integers A_i . The next Q lines contains 3 integers each L,R and X . Examples Example 1: Input: 5 2 2 3 1 4 5 1 3 2 3 5 2 Output: 1 16 Constraints 1 <= N, Q <= 10^5 1 <= A_i, X <= 10^9 1 <= L, R <= N