Home leetcode Leetcode 504 Base 7 Solution in c++ | Hindi Coding Community Leetcode 504 Base 7 Solution in c++ | 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" string convertToBase7(int num) { int res = 0; for(int i=0; num!=0; res += pow(10,i++)*(num % 7), num /= 7) {} return to_string(res); } Tags competetivecodingCPPdsahcchindicodingcommunityleetcode Facebook Twitter Whatsapp Newer Older