1076. Brace Expansion

Medium
String
Backtracking
Stack
Breadth-First Search
Sorting

Description

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}")

Statistics

Acceptance
66.7%
Submissions
95,261
Accepted
63,559