Python solution using DFS gets RTE even with sys.setrecursionlimit set to a high number

Revision en1, by filo, 2019-03-26 15:38:08

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?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English filo 2019-03-26 15:38:08 522 Initial revision (published)