Array spiral print anticlockwise

my code - https://ide.codingblocks.com/s/46275
the example given is passed and i am getting wrong answer ina ll the test cases pls help

Hey Ankit, check your code for this test case.
input:
4 3
11 12 13
21 22 23
31 32 33
41 42 43