
The first line of the input contains an integer, 'T,’ denoting the number of test cases.
The first line of each test case contains an integer, 'N,’ denoting the number of elements in the array 'ARR'.
The second line of each test case contains 'N' space-separated integers denoting the elements of the array 'ARR'.
For each test case, print 'N' space-separated integers in which the i’th integer should denote the bitwise OR of ARR[i] and ARR[i+1].
Print the output of each test case in a new line.
You do not need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 10
1 <= N <= 10^5
0 <= ARR[i] <= 10^9
Where 'ARR[i]' denotes the 'i'th' element of the array 'ARR'.
Time Limit: 1 sec
The idea is to iterate through the input array from left to right, and for each element find the Bitwise OR of it and the element placed adjacent to it. We also need to observe that the last element of the array will never be modified as there will never be an element present to its right. It is important to note that, if we traverse the array
from right to left and not left to right, then the obtained result will not be correct as we will be using the updated values of the array elements in our calculations which will not produce the correct result.