BFS solution to ladderLength