Find bitwise OR of all possible sub-arrays
Given an array A of size N where, [Tex]1\leq N \leq 10^{5} [/Tex]. The task is to find the OR of all possible sub-arrays of A and then the OR of all these results. Examples: Input : 1 4 6 Output : 7 All possible subarrays are {1}, {1, 4}, {4, 6} and {1, 4, 6} ORs of these subarrays are 1, 5, 6 and 7