标签:
1 public class Solution { 2 public List<String> generatePossibleNextMoves(String s) { 3 List<String> 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 }
标签:
原文地址:http://www.cnblogs.com/shuashuashua/p/5645811.html