Java Solution with explanation for any base
\n    public String baseNeg2(int N) {\n        return baseNegative(N, -2);\n    }\n\n    /*\n    The remainder operator can be used with negative integers. The 
```\n    public String baseNeg2(int N) {\n        return baseNegative(N, -2);\n    }\n\n    /*\n    The remainder operator can be used with negative integers. The rule is:\n\n    Perform the operation as if both operands were positive.\n    If the left operand is negative, then make the result negative.\n    If the left operand is positive, then make the result positive.\n    Ignore the sign of the right operand in all cases.\n    For example:\n\n    17 %  3 == 2     -17 %  3 == -2\n    17 % -3 == 2     -17 % -3 == -2\n    */\n    private String baseNegative(int n, int base) {\n        StringBuilder sb = new StringBuilder();\n        while (n != 0) {\n            int remainder = n % base;\n            n = n / base;\n            //This is the only difference compared to regular base conversion\n            if (remainder < 0) {\n                remainder += -base;\n                n += 1;\n            }\n            sb.append(remainder);\n        }\n        return sb.length() == 0 ? "0" : sb.reverse().toString();\n    }\n```
[]