100% beat - very simple solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string convertToBase7(int num) {\n        string ans="";\n        int c=0;\n        if(num<0){\n            num=num*-1;\n            c=1;\n        }\n        while(true){\n            if(num>=7){\n            int t=num%7;\n            num=num/7;\n            ans=to_string(t)+ans;\n            }\n\n            if(num<7){\n                ans=to_string(num)+ans;\n                break;\n            }\n        }\n        if(c==1){\n            ans="-"+ans;\n        }\n        return ans;\n    }\n};\n```
['C++']