Wave Print Pattern

Sir I have tested my code several times and it is giving the correct answer for custom input as well as for the sample input given with the question. Please tell me the mistake in my code and the appropriate changes to be made.

you are taking input of n and m in wrong order.

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.

Yes sir!
My doubt was cleared within 5 mins of after I raised my doubt