Verbose Java Solution
Just keep dividing the current number by 7...\n\n\npublic class Solution {\n    public String convertTo7(int num) {\n        if (num == 0) return "0";\n        
Just keep dividing the current number by 7...\n\n```\npublic class Solution {\n    public String convertTo7(int num) {\n        if (num == 0) return "0";\n        \n        StringBuilder sb = new StringBuilder();\n        boolean negative = false;\n        \n        if (num < 0) {\n            negative = true;\n        }\n        while (num != 0) {\n            sb.append(Math.abs(num % 7));\n            num = num / 7;\n        }\n        \n        if (negative) {\n            sb.append("-");\n        }\n        \n        return sb.reverse().toString();\n    }\n}\n```
[]