Convert to Base 7
Return the base 7 representation of the integer num as a string. A negative number gets a leading -, and zero is "0".
Example 1
num 100
returns "202"
100 = 2*49 + 0*7 + 2, so "202".
Example 2
num -7
returns "-10"
"-10".
Constraints
-107 <= num <= 107
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.