Given an integer n, generate the binary representations of the numbers from 1 to n in order and return them as a list of strings. A queue-based approach appends '0' and '1' to previously generated numbers. The input is JSON {n}.
Input: JSON {n}.
Output: Array — binary strings for 1..n.
Input: {"n":5}
Output: ["1","10","11","100","101"]
Explanation: Binary of 1 through 5.Input: {"n":1}
Output: ["1"]
Explanation: Just 1.Input: {"n":3}
Output: ["1","10","11"]
Explanation: Binary of 1,2,3.1<=n<=10^4