ques is Word Ladder II on leetcode , 126 number …
I have seen solution of people also, but i am not getting exactly how things are going …
Please someone explain me throughly .
Anybody can explain the logic?
@Muskan-Gupta-598128740703036
think it as a graph problem where each string(or word) is a node and two nodes have an edge between them if there is exactly one character different between them.
You also need to map strings to integers(node number) and then you have source and destination, it just becomes a shortest path search problem which can be done using djiktra and also simple BFS (as each edge has cost=1).
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.