Trying this leetcode problem : https://leetcode.com/problems/word-ladder/

I am basically doing a dfs condition. Treating each word that is at an edit distance of 1 with each other as a connected node with an edge.

However, I am not able to make my dfs exit properly because of which I am getting a run-time error. I know there are better solutions but could you please help me fix my implementation.

Here is my solution:

```
https://ideone.com/S9YQLY
```

I really tried adding the solution here, but for some reason the formatting keeps getting screwed.