Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
2,416 views

in Online Assessments by Expert (144,420 points)

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 (144,420 points)
...