Only test case 3 is satisfying other cases are showing run-time error.
Sort game question giving run time error
You have taken the size of sal and string array as 100 which is wrong, the size of array is n but the element inside that array are of range or length 100.
Also, this code may give TLE because you have use O(N^2) approach and N is 10^5 but you can trya and optimize it if needed using some other sorting algorithm