'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 a number 'N', you need to find a string having “1” or “0” that is equivalent to the value of integer 'N' in base “-2”.

```
The resulting string must not have leading zeros unless the string is “0”.
```

```
If 'N' = 4, then its value in base ‘-2’ will be “100” as 0*(-2)^0 +0*(-2)^1 + 1*(-2)^2 = 4.
```

Detailed explanation

```
1 <= T <= 50
0 <= N <= 10^9
Time limit: 1 sec
```

```
2
6
2
```

```
11010
110
```

```
Test Case 1: Value of string “11010” in base ‘10’ = 0*(-2)^0 +1*(-2)^1 + 0*(-2)^2 +1*(-2)^3 +1*(-2)^4 = 0 + (-2) + 0 + (-8) + (16) = 6.
Test Case 2: Value of string “110” in base ‘10’ = 0*(-2)^0 +1*(-2)^1 + 1*(-2)^2 = 0 + (-2) + 4 = 2.
```

```
2
5
8
```

```
101
11000
```