You are given an array of size N . Let’s create all the subsets of this array which contain at least 2 elements. Now, operate AND over the elements of each subset, and store the results in a new array. Your task is to find out the minimum value of this new array.
Sample Input
1 2 3
Sample Output
0
Explanation
Possible Subset : (1,2) , (1,3) , (2,3) , (1,2,3) : Minimum value from
{( 1&2 ) , ( 1&3 ) ,( 2&3 ) , ( 1&2&3 )} = Minimum value from { 0,1,2,0 } is 0.