New update is available. Click here to update.

Last Updated: 23 Jun, 2021

Difficulty: Easy

```
Let the first array be : ‘arr1’ = {1,5,8,4} and the second array be ‘arr2’ = {3,7,16,1}
For this, the maximum sum takes the sub-array {5,8} from the first ‘arr1’ and {7,16} from arrays, two, the OR sum will be 13 + 23 = 26, which is maximum.
```

```
The first line contains a single integer ‘T’ denoting the number of test cases to be run. Then the test cases follow.
The first line of each test case contains an integer ‘N’ denoting the number of elements in the array.
The second line contains ‘N’ space-separated integers denoting the elements of the first array.
The third line contains ‘N’ space-separated integers denoting the elements of the second array.
```

```
For each test case, print an integer denoting the maximum OR sum.
Output for each test case will be printed in a separate line.
```

```
You are not required to print anything; it has already been taken care of. Just implement the function.
```

```
1 <= T <= 10
1 <= N <= 10^5
1 <= arr1[i], arr2[i] <= 10^5
Time Limit: 1 sec.
```

SIMILAR PROBLEMS

Missing Number

Posted: 30 Oct, 2022

Difficulty: Easy

Longest Subarray With Zero Sum

Posted: 3 Nov, 2022

Difficulty: Moderate

Merge Two Sorted Arrays Without Extra Space

Posted: 19 Nov, 2022

Difficulty: Moderate

Ninja And The Strictly Increasing Array

Posted: 27 Nov, 2022

Difficulty: Moderate

Negative To The End

Posted: 16 Dec, 2022

Difficulty: Easy

Popular Interview Problems: