Simple 2 lines solution in C++
class Solution {\npublic:\n    string convertToBase7(int num) {\n      if(num < 0) return "-" + convertToBase7(-num);\n      return (num/7>0) ? convertToBase7(n
```class Solution {\npublic:\n    string convertToBase7(int num) {\n      if(num < 0) return "-" + convertToBase7(-num);\n      return (num/7>0) ? convertToBase7(num/7) + to_string(num%7) : to_string(num%7);\n    }\n};\n```
[]