30:00
Given an integer num, return a string with its base 7 representation. Negative numbers keep a leading minus sign.
−107≤num≤107-10^7 \leq \text{num} \leq 10^7−107≤num≤107
Run code to see results.
Convert 100 to base 7. Dividing by 7 peels off the last base-7 digit as the remainder, the same way dividing by 10 peels off the last decimal digit.
Division ladder: n = 7 × q + r
Base-7 answer, filled from the right
0 of 3 digits found
Given an integer, return its base 7 representation as a string, keeping a leading minus sign for negative numbers.