FunctionRacerProblemsRace

Decimal to Binary String

BeginnerMathPython, JavaScript, TypeScript

Return the binary form of the non-negative integer n as a string of 0 and 1 characters, with no leading zeros (zero is "0"). Do not use bin or format.

Example 1

n 10
returns "1010"

"1010".

Example 2

n 0
returns "0"

"0".

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