Given two words (beginWord and endWord) and a dictionary's word list, return the length of the shortest transformation sequence from beginWord to endWord. Each transformation can change only one letter.
beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]5