|
4 | 4 | importjava.util.Arrays;
|
5 | 5 | importjava.util.List;
|
6 | 6 |
|
7 |
| -/** |
8 |
| - * 1087. Brace Expansion |
9 |
| - * |
10 |
| - * A string S represents a list of words. |
11 |
| - * Each letter in the word has 1 or more options. If there is one option, the letter is represented as is. |
12 |
| - * If there is more than one option, then curly braces delimit the options. |
13 |
| - * For example, "{a,b,c}" represents options ["a", "b", "c"]. |
14 |
| - * For example, "{a,b,c}d{e,f}" represents the list ["ade", "adf", "bde", "bdf", "cde", "cdf"]. |
15 |
| - * |
16 |
| - * Return all words that can be formed in this manner, in lexicographical order. |
17 |
| - * |
18 |
| - * Example 1: |
19 |
| - * Input: "{a,b}c{d,e}f" |
20 |
| - * Output: ["acdf","acef","bcdf","bcef"] |
21 |
| - * |
22 |
| - * Example 2: |
23 |
| - * Input: "abcd" |
24 |
| - * Output: ["abcd"] |
25 |
| - * |
26 |
| - * Note: |
27 |
| - * 1 <= S.length <= 50 |
28 |
| - * There are no nested curly brackets. |
29 |
| - * All characters inside a pair of consecutive opening and ending curly brackets are different. |
30 |
| - * */ |
31 | 7 | publicclass_1087 {
|
32 | 8 | publicstaticclassSolution1 {
|
33 | 9 | publicString[]expand(StringS) {
|
|