C++ solution
```\nclass Solution {\npublic:\n    string convertTo7(int num) {\n        if(num == 0) return "0";\n        string str ="";\n        \n        if(num < 0) retur
```\nclass Solution {\npublic:\n    string convertTo7(int num) {\n        if(num == 0) return "0";\n        string str ="";\n        \n        if(num < 0) return "-" + convertTo7(-num);\n        while( num > 0){\n            int rem = num % 7;\n            num = num/7;\n            \n            str = to_string(rem) + str;\n        }\n        \n        return str;\n    }\n\n        return str;
[]