the last number printed is wrong
the test case is 4*4
(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16)
Clockwise spiral print 2d matrix
you need to use >= instead of >
Corrected Code
but number 9 is being repeated
i have solved it now. thanks
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.