100% beats in c++ solution.
IntuitionApproachComplexity
Time complexity:O(log7(N))

Space complexity:O(log7(N))
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:O(log7(N))
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:O(log7(N))
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    string convertToBase7(int num) {
        if(num==0){
            return "0";
        }
        string s;
        int minus=0;
        if(num<0){
            minus=-1;
            num*=-1;
        }
        while(num){
            s+=(num%7)+'0';
            num/=7;
        }
       
        reverse(s.begin(),s.end());
         if(minus==-1){
            s="-"+s;
        }
        return s;
    }
};
```
['C++']