132: Generate all binary numbers
Given a number of digits
, return all binary numbers
that have exactly that many digits
Example 1
Input: 2
Output: ["00", "01", "10", "11"]
Example 2
Input: 1
Output: ["0", "1"]
Helpful article
Given a number of digits
, return all binary numbers
that have exactly that many digits
Example 1
Input: 2
Output: ["00", "01", "10", "11"]
Example 2
Input: 1
Output: ["0", "1"]