1017. Convert to Base -2
Given a number N
, return a string consisting of "0"
s and "1"
s that represents its value in base -2
(negative two).
The returned string must have no leading zeroes, unless the string is "0"
.
Example 1:
Example 2:
Example 3:
Note:
0 <= N <= 10^9
Last updated
Was this helpful?