nodejs way to solve hangman question, private algorithm not think about efficiency.