Doubling Part in Spiral Print of Array

In this I have tried spiral print of 2D array nd have made the exact code as explained in video but still the output is having duplicate values. Can you please find the error and help me sort it out.

hello @mr.nanakskhurana
use a count variable that keeps track of number of printed element.

stop printing if count == n*m

Didn’t get it, can you please explain like where to put the count

check this->

okay, got it. Thank you buddy

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.