Code same as shown in vdeo lecture in not passing all the testcases

in the video of spiral matrix print, we add two more conditions to check if startrow<endrow and startcolumn<endcolumn to avoid duplicate printing of middle row or columns but using these two conditions here does not print spiral matrix correctly
Whereas these 2 conditions are not written then it is printing correctly and all testcases are getting passes.
please tell why these 2 conditions are not required in this problem.

we need to use <= instead of <

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.