Ezvor

1087. Brace Expansion

MediumString Preparing judge… LeetCode
StringBacktrackingStackBreadth-First SearchSorting

Hints

Hint 1
All generated strings are of the same size. How can we generate all of these strings?
Hint 2
Do a backtracking on which each level of it has to choose one single (e.g. 'a') character or any character of the given parenthesized group (e.g. "{a,b,c}")