Actually a wrong solution, but accepted by leetcode. As show in WordLadderERROR.java