Word Ladder II
Hard · Backtracking · about 40 minutes
Asked at Amazon, Google, Microsoft, Uber, Meta.
Given beginWord, endWord and a dictionary wordList, return all shortest transformation sequences from beginWord to endWord, in any order. Each step changes exactly one letter, and every intermediate word (and endWord) must be in wordList. Return [] if there is no sequence.