<awangdev>Flip Game II_3.java
public boolean canWin(String s) {
        if (s == null || s.length() <= 1) {
            return false;
        }
        String str = new String(s);
        for (int i = str.indexOf("++"); i >= 0 && i < str.length() - 1; i = str.indexOf("++")) {
           if (!canWin( s.substring(0, i) + "--" + s.substring(i + 2))) {
               return true;
           }
            str = str.substring(0, i) + "-" + str.substring(i + 1);
        }
        return false;
    }
public boolean sample_funcname ( String s ) {
  if ( s == null || s . length ( ) <= 1 ) {
    return false ;
  }
  String str = new String ( s ) ;
  for ( int i = str . indexOf ( "++" ) ;
  i >= 0 && i < str . length ( ) - 1 ;
  i = str . indexOf ( "++" ) ) {
    if ( ! canWin ( s . substring ( 0 , i ) + "--" + s . substring ( i + 2 ) ) ) {
      return true ;
    }
    str = str . substring ( 0 , i ) + "-" + str . substring ( i + 1 ) ;
  }
  return false ;
}
