In a Duolingo vocabulary lesson, a learner can transform one word into another by changing exactly one character at a time. Every intermediate word must appear in the supplied vocabulary. Given a starting word, a target word, and the vocabulary, return the minimum number of words in a valid transformation sequence, including both endpoints. Return 0 if no sequence exists.
Implement shortest_word_ladder(begin_word, end_word, word_list).
begin_word: a lowercase string.end_word: a lowercase string with the same length as begin_word.word_list: a list of lowercase vocabulary strings, all with the same length.0 when the target cannot be reached.Two words are adjacent when they have the same length and differ in exactly one position.
def shortest_word_ladder(begin_word, end_word, word_list):