cpp implementation of Word Ladder II with TLE