This is a problem from THOUGHTWORKS HIRING CONTEST.

Problem Link: Log In | HackerEarth

**Problem Statement:

**

Given an array A. Is there any subset of array A in which if we do AND of all elements of that subset then output should be in power of two (for example : 1,2,4,8,16 and so on ).

2 3 1 2 3 2 10 20

Input:

First line contains number of test cases T. Each test first line contains N size of array A and next line contains N space separated integers.

I found this problem somewhat similar to problem XORSUB but still was unable to solve this, Can anyone please explain how to solve this problem?