(beginWord, endWord, wordList)
return 0
Bidirectional BFS!!!
    :type beginWord: str
    :type endWord: str
    :type wordList: Set[str]
    :rtype: int
Bidirectional BFS!!!
    :type beginWord: str
    :type endWord: str
    :type wordList: Set[str]
    :rtype: int
Bidirectional BFS!!! : type beginWord : str : type endWord : str : type wordList : Set [ str ] : rtype : int
def ladderLength(beginWord, endWord, wordList):
    """
    Bidirectional BFS!!!
    :type beginWord: str
    :type endWord: str
    :type wordList: Set[str]
    :rtype: int
    """
    beginSet = set()
    endSet = set()
    beginSet.add(beginWord)
    endSet.add(endWord)
    result = 2
    while len(beginSet) != 0 and len(endSet) != 0:
        if len(beginSet) > len(endSet):
            beginSet, endSet = endSet, beginSet
        nextBeginSet = set()
        for word in beginSet:
            for ladderWord in wordRange(word):
                if ladderWord in endSet:
                    return result
                if ladderWord in wordList:
                    nextBeginSet.add(ladderWord)
                    wordList.remove(ladderWord)
        beginSet = nextBeginSet
        result += 1
        print(beginSet)
        print(result)
    return 0
def ladderLength ( beginWord , endWord , wordList ) : beginSet = set ( ) endSet = set ( ) beginSet . add ( beginWord ) endSet . add ( endWord ) result = 2 while len ( beginSet ) != 0 and len ( endSet ) != 0 : if len ( beginSet ) > len ( endSet ) : beginSet , endSet = endSet , beginSet nextBeginSet = set ( ) for word in beginSet : for ladderWord in wordRange ( word ) : if ladderWord in endSet : return result if ladderWord in wordList : nextBeginSet . add ( ladderWord ) wordList . remove ( ladderWord ) beginSet = nextBeginSet result += 1 print ( beginSet ) print ( result ) return 0