Easy · Backtracking
Generate Binary Strings
Given an integer n, return all 2^n strings of length n that use only the characters '0' and '1', in any order.
Examples
Example 1
n = 3Output: 8 strings
Example 2
n = 2Output: 4 strings
Rebuild it in the studio
Core interview problems are free with a full runner and lessons; Pro opens the complete library.