Home leetcode Leetcode 504 Base 7 Solution in java | Hindi Coding Community Leetcode 504 Base 7 Solution in java | Hindi Coding Community Author - Akash December 28, 2023 0 Given an integer num, return a string of its base 7 representation.Example 1:Input: num = 100Output: "202"public String convertTo7(int num) { if (num < 0) return '-' + convertTo7(-num); if (num < 7) return num + ""; return convertTo7(num / 7) + num % 7;} Tags competetivecodingdsahcchindicodingcommunityjavaleetcode Facebook Twitter Whatsapp Newer Older