Array sort i( my code is not working

this is not working for test case 1 and
pls tell me the correct answer

hi @techarun121_523aa3514e575ce9 updated and commented