C++ Implementation of quora's scrabble stepladder challenge question