Given begin word, end word, and a word list, return the number of words in the shortest transformation sequence from begin to end, changing one letter at a time, where each intermediate word must be in the list. Return 0 if no sequence exists. Input: JSON {begin, end, words}.
Input: JSON {begin, end, words}.
Output: Integer — sequence length or 0.
Input: {"begin":"hit","end":"cog","words":["hot","dot","dog","lot","log","cog"]}
Output: 5
Explanation: hit->hot->dot->dog->cog.Input: {"begin":"hit","end":"cog","words":["hot","dot","dog","lot","log"]}
Output: 0
Explanation: 'cog' not in list.1<=word.length<=101<=words.length<=5000all same length