Dsa
Recursion
Warm-up
Find All Combinations
Create a program that finds all combinations of a given string, with each combination of characters appearing once. The order of combinations does not matter.
Input format:
- A single string (1 <= length <= 10).
Output format:
- Print all unique combinations, each on a new line, in alphabetical order.
Example:
Input:
abc
Output:
a
ab
abc
ac
b
bc
c
Key concepts
recursioncombinatorics
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