Python simple mapping
The key point is, on even digits and odd digits have different signs. \nThen we tries to work on every 2 digites for combination.\nIf remainder is 2, or 3, we n
The key point is, on even digits and odd digits have different signs. \nThen we tries to work on every 2 digites for combination.\nIf remainder is 2, or 3, we need to borrow 1 from higher base.\n```\nclass Solution(object):\n    def baseNeg2(self, N):\n        """\n        :type N: int\n        :rtype: str\n        """\n        if N == 0:\n            return "0"\n        dic =  {0:"00", 1:"01",2:"10",3:"11"}\n        dic2 = {1:"1",2:"10",3:"11"}\n        res = ""\n        while N > 0:\n            rem = N % 4                           \n            N /= 4\n            if rem >=2:\n                N += 1\n            if N == 0:\n                res = dic2[rem] + res\n            else:\n                res = dic[rem] + res\n            \n        return res
[]