File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 19
19
If there is no valid move, return an empty list [].*/
20
20
public class _293 {
21
21
22
- public List <String > generatePossibleNextMoves (String s ) {
23
- List <String > result = new ArrayList <String >();
24
- for (int i = 1 ; i < s .length (); i ++) {
25
- if (s .charAt (i ) == '+' && s .charAt (i - 1 ) == '+' ) {
26
- result .add (s .substring (0 , i - 1 ) + "--" + s .substring (i + 1 ));
22
+ public static class Solutoin1 {
23
+ public List <String > generatePossibleNextMoves (String s ) {
24
+ List <String > result = new ArrayList <>();
25
+ for (int i = 1 ; i < s .length (); i ++) {
26
+ if (s .charAt (i ) == '+' && s .charAt (i - 1 ) == '+' ) {
27
+ result .add (s .substring (0 , i - 1 ) + "--" + s .substring (i + 1 ));
28
+ }
27
29
}
30
+ return result ;
28
31
}
29
- return result ;
30
32
}
31
-
32
33
}
You can’t perform that action at this time.
0 commit comments