'Coding has over 700 languages', '67% of programming jobs aren’t in the
technology industry', 'Coding is behind almost everything that is powered
by electricity'

Topics

Given an integer ‘N’, the task is to find the number of integers between 1 to N whose decimal number representation contains only 0s and 1s.

For example, 1011 , 11, 100 are all valid integers since they consist of 1s and 0s only, however 210, 3401 are not valid integers.

```
You don’t need to print anything. It has already been taken care of. Just implement the given function.
```

Detailed explanation

```
1 <= T <= 10^4
1 <= N <= 10^9
Time Limit: 1sec
```

```
2
10
21
```

```
2
3
```

```
In first case, there are only 2 numbers between 1 to 10 that contain only 1s or 0s i.e (1,10)In second case, there are only 3 numbers containing only 0s and 1s i.e (1,10,11)
```

```
3
250
1505
3010
```

```
7
15
15
```