Binary numbers

3.4

37 votes
1-D Array, Arrays, Data Structures, Medium, String Manipulation
Problem

You are given a set of binary elements. You have to eliminate the binary numbers that contain  as a substring. The resultant sequence will be 1, 10, 100, 101, 1000, and so on.

You are required to generate the code to determine the value of the new sequence.

Input format

  • First line:  denoting the number of test cases
  • Next lines: A single integer

Output format

Print lines representing the code to display the value.

Constraints

Sample Input
2
3
9
Sample Output
100
10001
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Test case 1: The sequence is 1,10,100 and so on . So the 3rd element of sequence is 100

Editor Image

?