Given a positive integer N. The task is to check whether this integer has an alternate pattern of 0 and 1 in its binary representation or not.
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. Each test case contains a number N as input.
For each test case, print "1" if the integer has alternate 0 and 1 in its binary representation else print "0".
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.