|All-time Popular Problems|
|Maximum difference between node and its ancestor|
|Delete a node from BST|
|K’th smallest element|
|Detect cycle in a directed graph|
|Element with left side smaller and right side greater|
|Sort The Array|
|Level order traversal Line by Line|
|Add two numbers represented by linked lists|
|Root to leaf path sum|
Given a non-negative integer N. The problem is to check if binary representation of n is palindrome or not. Note that the actual binary representation of the number is being considered for palindrome checking, no leading 0’s are being considered.
The first line of the input contains a single integer T, denoting the number of test cases. Then T test case follows. Each test case contains a single line of input denoting the number N.
For each test case, print 1 if binary representation of N is palindrome; else print 0.
For testcase 2: The binary representation of 2 is 10, and of course, 10 is not a palindrome.
For testcase 3: The binary representation of 3 is 11, needless to say, 11 is a palindrome.