Return the binary representations of 1, 2, 3, ..., n as a list of strings (["1", "10", "11", "100", ...]). Use a queue rather than converting each number.
Example 1
Input:
binary_numbers_up_to(5)
Output:
['1', '10', '11', '100', '101']
Example 2
Input:
binary_numbers_up_to(0)
Output:
[]
0 <= n <= 200000No results yet
Run your code to check it against the examples, or submit to run every test.