Sort Game Doubt

there is TLE because of sorting technique but why does it show wrong answers?