Getting runtime error with TSORT problem, no idea why!?

Hi,

I am new to this forum and also recently started coding practice on Codechef.

I was trying to solve this problem. My solution works fine with the example input but getting Runtime Error (NZEC) while submitting it. My submission code is 26613220.

Will appreciate any help on this. Also is there a way to find out error stack while submitting the code?

ac solution
for sorting purpose try using standard sort.
hope it helps:)

Thanks yash4421 for taking an interest in this. I understand your suggestion but what I am more interested is to find out problem with my approach rather than a solution.

Appreciate your help.

It might be because Python has a limit on recursion depth (since you’re writing a recursive function).

Good point, I’ll look into this. Thanks!