|
3 | 3 | importjava.util.ArrayDeque;
|
4 | 4 | importjava.util.Deque;
|
5 | 5 |
|
6 |
| -/** |
7 |
| - * 1003. Check If Word Is Valid After Substitutions |
8 |
| - * |
9 |
| - * We are given that the string "abc" is valid. |
10 |
| - * |
11 |
| - * From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated with Y) is equal to V. (X or Y may be empty.) Then, X + "abc" + Y is also valid. |
12 |
| - * |
13 |
| - * If for example S = "abc", then examples of valid strings are: "abc", "aabcbc", "abcabc", "abcabcababcc". Examples of invalid strings are: "abccba", "ab", "cababc", "bac". |
14 |
| - * |
15 |
| - * Return true if and only if the given string S is valid. |
16 |
| - * |
17 |
| - * Note: |
18 |
| - * * 1 <= S.length <= 20000 |
19 |
| - * * S[i] is 'a', 'b', or 'c' |
20 |
| - */ |
21 |
| - |
22 | 6 | publicclass_1003 {
|
23 | 7 | publicstaticclassSolution1 {
|
24 | 8 | publicbooleanisValid(StringS) {
|
|