please help for how i can remove TLE error from it MY SOLUTIN IS https://www.codechef.com/viewsolution/22485054 asked 15 Jan, 00:35

https://www.geeksforgeeks.org/sortingalgorithms/ has a good overview of the sorting algorithms. What you implemented is "Bubble Sort" with the time complexity $O(N^2)$ hence the Time Limit Exceeded solution status. You may want to consider more efficient sorting algorithms. For this particular problem  due to the given constraints  a good choice is Pigeonhole Sort: https://www.geeksforgeeks.org/pigeonholesort/ answered 15 Jan, 04:17
