Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Word Ladder #20

Open
pratikj697 opened this issue Oct 1, 2024 · 1 comment
Open

Word Ladder #20

pratikj697 opened this issue Oct 1, 2024 · 1 comment
Assignees

Comments

@pratikj697
Copy link

pratikj697 commented Oct 1, 2024

In this problem given two words, begin Word and end Word, and a dictionary word List, return the number of words in the shortest transformation sequence from beginWord to endWord, or 0 if no such sequence exists. Only one letter can be changed at a time, and each transformed word must exist in the word list.
For example:
Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log","cog"]
Output: 5
One shortest transformation is "hit" -> "hot" -> "dot" -> "dog" -> "cog", which is 5 words long.

Input: beginWord = "hit", endWord = "cog", wordList = ["hot","dot","dog","lot","log"]
Output: 0
The endWord "cog" is not in the word list, so the transformation is not possible.

Constraints are:
1 <= beginWord.length <= 10
endWord.length == beginWord.length
1 <= wordList.length <= 5000
wordList[i].length == beginWord.length
beginWord, endWord, and wordList[i] consist of lowercase English letters.

Can you please assign this problem to me @indrakishore

@shrutipuskar
Copy link

plz assign this task to me and also add hactoberfest tag........

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants