Spiral pattern problem

sir my code is failing one test case (first one)
.It is getting compiled and showing correct answer but failing test cases

Hey @Megha2468


Please see this. 2 if conditions were wrong,

If your doubt is resolved please mark it as closed.

sir after doing the changes it is passing only one test case (test case 1)

@Megha2468


I missed something
Please see this

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.