comefrom: <awangdev>293. Flip Game_2.java
code: public List<String> generatePossibleNextMoves(String s) {
          List<String> rst = new ArrayList<String>();
          if (s == null || s.length() == 0) {
              return rst;
          }
          ArrayList<Integer> list = new ArrayList<Integer>();
          StringBuffer sb = new StringBuffer(s);
          while (sb.indexOf("++") != -1) {
              int index = sb.indexOf("++");
              list.add(index);
              sb.replace(index, index + 1, "*");
          }
          for (int index : list) {
              rst.add(s.substring(0, index) + "--" + s.substring(index + 2));
          }
          return rst;
      }
masked: public List < String > var_0 ( String var_1 ) {
    List < String > var_2 = new ArrayList < String > ( ) ;
    if ( var_1 == null || var_1 . length ( ) == 0 ) {
      return var_2 ;
    }
    ArrayList < Integer > var_3 = new ArrayList < Integer > ( ) ;
    StringBuffer var_4 = new StringBuffer ( var_1 ) ;
    while ( var_4 . indexOf ( "++" ) != - 1 ) {
      int var_5 = var_4 . indexOf ( "++" ) ;
      var_3 . add ( var_5 ) ;
      var_4 . replace ( var_5 , var_5 + 1 , "*" ) ;
    }
    for ( int var_5 : var_3 ) {
      var_2 . add ( var_1 . substring ( 0 , var_5 ) + "--" + var_1 . substring ( var_5 + 2 ) ) ;
    }
    return var_2 ;
  }
  