Dsa
Recursion
Warm-up
Generate Binary Strings
Given an integer n, generate all binary strings of length n. You need to implement this using recursion.
Input Format:
- A single integer n (1 <= n <= 10).
Output Format:
- A list of binary strings of length n.
Example:
Input:
3
Output:
['000', '001', '010', '011', '100', '101', '110', '111']
Key concepts
recursionstringscombinatorics
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now