Base 7 C++|| 0ms(100%)
\t\tclass Solution {\n\t\tpublic:\n\t\t\tstring convertToBase7(int num) {\n\t\t\tint sum=0;\n        string ans;\n        int temp=num;\n       vectorarr;\n    
\t\tclass Solution {\n\t\tpublic:\n\t\t\tstring convertToBase7(int num) {\n\t\t\tint sum=0;\n        string ans;\n        int temp=num;\n       vector<int>arr;\n        string str="";\n        if(temp<0)\n        {str="-";\n        num=abs(num);\n        }if(num==0)\n            return "0";\n        while(num)\n        {\n        arr.push_back(num%7);\n            num=num/7;\n          \n        }\n        for(int i=arr.size()-1;i>=0;i--)\n        { str=str+to_string(arr[i]);\n        }   \n       \n        return str;\n\t\t\t}\n\t\t};
[]