Dsa
Backtracking
Warm-up
String Combinations
Given a string consisting of lowercase letters, generate all possible unique combinations of characters from that string. Each combination must be sorted in the order of appearance of the characters in the string.
Input format:
- A single line containing a lowercase string.
Output format:
- A list of all unique combinations in any order.
Example:
Input:
aabc
Output:
['a', 'aa', 'ab', 'abc', 'ac', 'b', 'bc', 'c']
Key concepts
backtrackingstrings
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