Word ladder version2. Calculate char set before BFS. Faster for small data but a little bit slower for big data.