Play With OR
Submissions: 1569   Accuracy:

49.79%

  Difficulty: Basic   Marks: 1

You are given an array A[] , you have to construct a new array A2[].
The values in A2[] are obtained by doing OR of consecutive elements in array.

Input:
First line of the input contains t, the number of test cases. Each line of the test case contains a number n specifying the number of elements.
Each 'n' lines denoting elements of array A[].

Output:
Each new line of the output contains element of array A2[] .

Constraints:
1<=T<=100
1<=n<=100000
1<=A[i]<=100000

 

Example:

Sample Input 0
1
5
10 11 1 2 3

Sample Output 0
11 11 3 3 3

 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: chunky_2808
Author: Chunky_2808


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.