Base 7
MATH
Problem
Given an integer num
, return a string representing its base 7 representation.
Examples
convertToBase7(49) // returns "100" // In base 7, 49 translates to 7^2 + 0*7^1 + 0*7^0 // which is "100". convertToBase7(0) // returns "0" // In base 7, 0 remains 0 convertToBase7(343) // returns "1000" // 343 is showcased as 7^3 + 0*7^2 + 0*7^1 + 0*7^0,
Loading...