beats 99.31%|| easy python solution
\nclass Solution:\n    def convertToBase7(self, num: int) -> str:\n        if num == 0:\n            return "0"\n        \n        res = ""\n        is_negative
```\nclass Solution:\n    def convertToBase7(self, num: int) -> str:\n        if num == 0:\n            return "0"\n        \n        res = ""\n        is_negative = num < 0\n        num = abs(num)\n        \n        while num > 0:\n            remainder = num % 7\n            res = str(remainder) + res\n            num //= 7\n        \n        if is_negative:\n            res = "-" + res\n        \n        return res\n\n```
[]