String sort problem

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

my code is running fine for sample test case but fails for test case. how to rectify it ?

Hey Yukti, your code is correct, I guess there is some issue with the platform, try to submit your answer after some time.

Hi Yukti, the problem problem was that your string array was only 10 items long. However, in the constraints it is given that n<=1000