Decimal to Base -2 || Java Solution 
IntuitionApproach
Instead of dividing by 2 as we usualy do in the Conversion of Decimal to Binary use "-2" to convert the Decimal to Base "-2"
Make sure that ea
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach 
 1. Instead of dividing by 2 as we usualy do in the Conversion of Decimal to Binary use "-2" to convert the Decimal to Base "-2"
 2. Make sure that each time the remainder should be either 0 or 1, and incase of a ***Negative remainder*** add 2 to the remainder and 1 to the n 


<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(log n) (since n is divided by -2 in each step)
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(log n)
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public String baseNeg2(int n) {
        //Decimal To Base "-2"
        StringBuilder bin = new StringBuilder();
        if(n == 0) return "0";
        while(n != 0){
              int rem = n% -2;
              n /= -2;

              if(rem < 0){
                    rem += 2;
                    n +=1;
              }

              bin.append(rem);
              
        }
        return bin.reverse().toString();
    }
}
```
['Math', 'Java']