Hi,
Relatively new to Python,
Here are two solutions one gets run time error another one gets accepted, basically the difference between two is that the first one uses DFS and the second one BFS. I know Python has limited stack size by default, that's why I increased it to 2000000, but didn't help, any idea why?