You are given a string s that represents a list of words.
Each position in the generated words can have one or more character choices:
If there is only
If there are multiple choices, they are enclosed within curly brackets and separated by commas, such as "{a,b,c}" representing the choices 'a', 'b', or 'c'.
Expand the string and return all possible words that can be formed, sorted in lexicographical order.
Constraints:
s.length
s consists of curly brackets '{' and '}', commas ',', and lowercase English letters.
s is guaranteed to be a valid input.
There are no nested curly brackets.
All characters inside a pair of consecutive opening and ending curly brackets are distinct.
You are given a string s that represents a list of words.
Each position in the generated words can have one or more character choices:
If there is only
If there are multiple choices, they are enclosed within curly brackets and separated by commas, such as "{a,b,c}" representing the choices 'a', 'b', or 'c'.
Expand the string and return all possible words that can be formed, sorted in lexicographical order.
Constraints:
s.length
s consists of curly brackets '{' and '}', commas ',', and lowercase English letters.
s is guaranteed to be a valid input.
There are no nested curly brackets.
All characters inside a pair of consecutive opening and ending curly brackets are distinct.