I looked for out of bound list elements but could not find any and also tried multiple test cases. they are running fine can anyone tell me for which case this is getting nzec?
I really worked on it for hours.
Look whenever dealing with graph question using python, avoid recursive approaches, use iterative approach, reason being python has a small recursion stack compared to other languages (cpp and JAVA), if you want to use recursive approach always use recursion limit.
I did. I dont really prefer asking anyone to debug my code. but i couldn’t get it right. I dont really work with recursion thats why i was having this problem.