TLE (Time Limit Exception): Need to optimize later
Refactor the WordLadder, but it is still TLE