Integer to binary

Write codeEasy12 min

Your task

Given a non-negative integer n, return its binary representation as a string without any '0b' prefix and without leading zeros, except that 0 itself returns '0'. For example 13 returns '1101'. You may not use Python's bin() builtin; build the digits yourself.

Examples

to_binary(n: int) -> str
Example 1
Inputto_binary(13)
Output"1101"