Https://ide.codingblocks.com/s/48872

https://ide.codingblocks.com/s/48872
Spiral Print Anticlockwise Solution…
3/4 test cases correct…
1 is incorrect
Please help in debugging

Hey Varun, your code is not handling all the cases. For eg.
input:
2 5
1 2 3 4 5
6 7 8 9 10

your code’s output :
1, 6, 7, 8, 9, 10, 5, 2, 3, 4, END

but the expected output is :
1, 6, 7, 8, 9, 10, 5, 4, 3, 2, END