1-line hacking (Python/JavaScript)
Obviously you can inline the s to get 1-liners.\nPython:\npython\nclass Solution:\n    def baseNeg2(self, N: int) -> str:        \n        s = int(\'AAAAAAAA\',
Obviously you can inline the ```s``` to get 1-liners.\nPython:\n```python\nclass Solution:\n    def baseNeg2(self, N: int) -> str:        \n        s = int(\'AAAAAAAA\', 16)\n        return bin((N + s) ^ s)[2 : ]\n```\nJavaScript:\n```\nvar baseNeg2 = function(N) {    \n    var s = 0xAAAAAAAA;\n    return ((N + s) ^ s).toString(2);\n};\n```\n\nExplanation\nAssume ```0 <= N < 4```, you have a binary representation ```[a, b]``` of ```N```, e.g. ```2 = [1, 0]```, then the negabinary representation of ```N``` will be ```[a, a, b]```, which can be easily verified. On the other hand ```N + 2 = [a + 1, b] = [a, a ^ 1, b]```. Then ```(N + 2) ^ 2 = [a ^ 0, a ^ 1 ^ 1, b ^ 0] = [a, a, b]```. The reasoning is the same for larger ```N``` that its negabinary representation is ```(N + 0b...10101010) ^ 0b...10101010```.\n\nInspired by http://www.inwap.com/pdp10/hbaker/hakmem/flows.html#item128
[]