πŸ’‘ Arrays-Spiral Print Anticlockwise


getting garbage values as output

@p45s99tik hey pratik there is a silly mistake in your code check you cin statement you are doing arr[R][C] instead you should do arr[i][j]

getting wrong answer on 2nd and 3rd test case

@p45s99tik hey Pratik, I think you’re doing in the wrong way I am sharing the edited code your code.

@p45s99tik can you please tell me what problem are you facing and why you sent me this line of code.

wrong answer on 3rd test case for above code

@p45s99tik di you try this question with different approach

not really, just handling edge cases outside of for loop

@p45s99tik so what do you want from my side ? debug the code?

yes i want to know why code is giving WA on third test case

@p45s99tik hey pratik consider this case
3 4
1 2 3 4
1 2 3 4
1 2 3 4
your output
1, 1, 1, 2, 3, 4, 4, 4, 3, 2, 3, 0, END
but it should be
1, 1, 1, 2, 3, 4, 4, 4, 3, 2, 2, 3, END

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.

how to pass third test case