Power Of 2 and Subsequences
Submissions: 534   Accuracy:

28.8%

  Difficulty: Easy   Marks: 2

Given is an array of size N, find all the subsequence which when multiplied results in a number which is Power of 2.

Input:

First line contains an integer T denoting number of Test Cases. First line of each test case contains N, the next line contains n integers of the array.

Output:

Print the total number of such subsequence exits. As this number can be very large print the result under modulo 10^9+7.

 

Constraints:
1<= T <=100
1<= N <=10^5
1<= A[i] <= 10^9

Example:
Input
1
3
1 6 2

Output
3

Explanation:

The subsequence that can be chosen is {1} , {2} and {1,2}.

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

Author: ShivamKD


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.