Given a number N, check whether it is sparse or not. A number is said to be a sparse number if in the binary representation of the number no two or more consecutive bits are set.
The first line of input contains an integer T denoting the number of test cases. The first line of each test case is number 'N'.
Print '1' if the number is sparse and '0' if the number is not sparse.
1 <= T <= 100
1 <= N <= 103
Testcase 1: Binary Representation of 2 is 10, which is not having consecutive set bits. So, it is sparse number.
Testcase 2: Binary Representation of 3 is 11, which is having consecutive set bits in it. So, it is not a sparse number.
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.