javascript 72ms 100%
Similar Question: https://leetcode.com/problems/adding-two-negabinary-numbers/\nMy Solution: https://leetcode.com/problems/adding-two-negabinary-numbers/discuss
Similar Question: https://leetcode.com/problems/adding-two-negabinary-numbers/\nMy Solution: https://leetcode.com/problems/adding-two-negabinary-numbers/discuss/1044015/javascript-use-BigInt-96ms\nreference\uFF1A https://en.wikipedia.org/wiki/Negative_base#Calculation\n\n```\nconst baseNeg2 = (N) => {\n    return ToNegabinary(BigInt(N));\n};\n\nconst ToNegabinary = (num) => {\n    let res = \'\';\n    while (num != 0n) {\n        let remainder = num % -2n;\n        num /= -2n;\n        if (remainder < 0n) {\n            remainder += 2n;\n            num++;\n        }\n        res = remainder.toString() + res;\n    }\n    return res.length == 0n ? \'0\' : res;\n};\n```
['JavaScript']