Given a start word, an end word, and a dictionary, return the length of the shortest sequence transforming start into end, changing one letter at a time, where every intermediate word is in the dictionary.
If you have ever thought about minimal mutation paths between sequences, the framing will feel familiar — it is BFS on a graph you never explicitly built.
Input: begin="hit", end="cog", words=["hot","dot","dog","lot","log","cog"]
Output: 5
Note: hit → hot → dot → dog → cog.
// hit Run to execute the sample tests
// Interactive editor preview. Live code execution arrives with your early-access cohort.