Skip to content

Commit 3014c12

Browse files
refactor 293
1 parent 7145380 commit 3014c12

File tree

1 file changed

+8
-7
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+8
-7
lines changed

src/main/java/com/fishercoder/solutions/_293.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@
1919
If there is no valid move, return an empty list [].*/
2020
public class _293 {
2121

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+
}
2729
}
30+
return result;
2831
}
29-
return result;
3032
}
31-
3233
}

0 commit comments

Comments
 (0)