Help regarding runtime error in python when I use recursion.

Revision en1, by codebuster_10, 2023-05-31 10:48:55

I submitted following solutions to This problem :

  • 207930808 : my submission using dfs gives runtime error on test 17 when ran on pypy — 64.
  • 207931701 : same submission using dfs gives runtime error on test 13 when ran on python — 3.
  • 207933061 : this submission using queue (without recursion) passes.
  • 207933318 : if I set recursion limit then this gives MLE on test 1 when ran on pypy — 64.
  • 207933634 : but same code as above gives runtime error on test 16 when ran on python — 3.

Can someone please help why this is happening and how to avoid these runtime errors while writing recursive functions in python ? Or maybe their is something wrong with my logic itself and functions are correct :|

Tags python

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English codebuster_10 2023-05-31 10:48:55 917 Initial revision (published)