Simple C++ || solution 100% fast || iterative
\nclass Solution {\npublic:\n    string convertToBase7(int num) {\n        int ans =0;\n        int j = 1;\n        while(num)\n        { \n            ans += (
```\nclass Solution {\npublic:\n    string convertToBase7(int num) {\n        int ans =0;\n        int j = 1;\n        while(num)\n        { \n            ans += (num%7)*j;\n            num /=7;\n            j*=10;\n        }\n        return to_string(ans);\n    }\n};\n```
['C']