Sort game doubt on 1st testcase passed

Please kindly help me with my code I can only pass the 1st testcase .

https://ide.codingblocks.com/s/50262