3 test cases at last are failing

i am not able to counter the error in the code, as while submitting my last3 test cases are failing , please check for the code
Code Link:-https://drive.google.com/file/d/1IF1BThCJWnUsXtvu0p6dSYPJH3HlJH3d/view?usp=sharing


Check now.

If still test cases does not pass then solve it here https://leetcode.com/problems/pancake-sorting/
There are some test case issues with this problem.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.