Output is correct but code is not getting accepted. Help needed

I need help in finding out why it is showing wrong answer because in my local ide with the test cases it is showing right output. Urgent help required . Thanks.

The solution is https://ide.codingblocks.com/s/209208

The problem is titled Sort Game.