<awangdev>293. Flip Game_1.java
public List<String> generatePossibleNextMoves(String s) {
        List<String> rst = new ArrayList<>();
        if (s == null || s.length() < 2) {
            return rst;
        }
        StringBuffer sb = new StringBuffer(s);
        for (int i = 0; i < s.length() - 1; i++) {
            String str = s.substring(i, i + 2);
            if (str.equals("++")) {
                sb.replace(i, i + 2, "--");
                rst.add(sb.toString());
                sb.replace(i, i + 2, "++");
            }
        }
        return rst;
    }
public List < String > var_1 ( String var_2 ) {
  List < String > var_5 = new ArrayList < > ( ) ;
  if ( var_2 == null || var_2 . length ( ) < 2 ) {
    return var_5 ;
  }
  StringBuffer var_10 = new StringBuffer ( var_2 ) ;
  for ( int var_12 = 0 ;
  var_12 < var_2 . length ( ) - 1 ;
  var_12 ++ ) {
    String var_15 = var_2 . substring ( var_12 , var_12 + 2 ) ;
    if ( var_15 . equals ( "++" ) ) {
      var_10 . replace ( var_12 , var_12 + 2 , "--" ) ;
      var_5 . add ( var_10 . toString ( ) ) ;
      var_10 . replace ( var_12 , var_12 + 2 , "++" ) ;
    }
  }
  return var_5 ;
}
