Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
304 views

in Online Assessments by Expert (108,690 points) | 304 views

1 Answer

0 like 0 dislike

You are given an array A of length N. He can perform the following operation on A:

1) Select an index i (1≤i≤N−1) and select an integer X (1≤X<2^20).

2) Set Ai​:=(Ai​⊕X) and A[i+1]​:=(A[i+1]​⊕X). (Here, ⊕ denotes the bitwise XOR operation)

Determine if you can make all the elements of equal by applying the above operation any number of times (possibly zero).

3

4

3 2 2 3

6

0 1 2 3 4 5

3

1 2 4

 

 

 

by Expert (108,690 points)