private String removeDuplicateWords(String phrase){
  String[] words=phrase.split(" ");
  String out="";
  boolean add=true;
  for (  String s : words) {
    if (add) {
      out+=s + " ";
      add=false;
    }
 else {
      add=true;
    }
  }
  if (words.length % 2 == 0)   return out + words[words.length - 1];
  return out;
}

private String removeDuplicateWords ( String phrase ) { String [ ] words = phrase . split ( " " ) ; String out = "" ; boolean add = true ; for ( String s : words ) { if ( add ) { out += s + " " ; add = false ; } else { add = true ; } } if ( words . length % 2 == 0 ) return out + words [ words . length - 1 ] ; return out ; }
removes every other word in the phrase
