FunctionRacerProblemsRace

Convert to Base 7

EasyMathPython, JavaScript, TypeScript, Java, C++

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

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Math problems