1 public class Solution { 2 public ListgeneratePossibleNextMoves(String s) { 3 List result = new ArrayList<>(); 4 if (s.length() < 2) { 5 return result; 6 } 7 8 for (int i = 0; i < s.length() - 1; i++) { 9 if (s.charAt(i) == '+' && s.charAt(i+1) == '+') {10 result.add(s.substring(0, i) + "--" + s.substring(i+2));11 }12 }13 return result;14 }15 }