Input: beginWord = "hit", endWord = "cog", wordList = ["hit", "hig", "hot","hog","lot","dog","cog","dot"]
Output: 3
Explanation: One shortest transformation sequence is "hit" -> "hot" -> "hog" -> "cog", which is 3 jumps away.
Find the shortest transformation from the beginWord to the endWord.
I could not finish this problem as I ran out of time. My idea was to build a word map of all the words and its neighbors which were 1 letter away. Then take the begin word and use recursion to go through its neighbors until it reaches the end word. If anyone has an optimal approach then let me know