Decimal to binary
mediumMaths and loops20 XP
Return the binary form of n (0 or more) as a string of 0s and 1s, without using built-in conversion: keep dividing by 2 and collect the remainders.
Examples
- Input: n = 5Output: "101"
- Input: n = 0Output: "0"
Examples use JSON: true/false/null are True/False/None in Python.