My solution is fine when I 'Test' but fails when I 'Submit' for a large testcase

my solution is fine when I ‘Test’ but fails when I ‘Submit’ for a large testcase. I’m stuck! :’(

did you solve it, have the same issue

I allocated the stacks on the heap instead and thanks GOD solved :smiley:

Click here to start solving coding interview questions