how to counter tle
Here in this code i am getting tle
Hey @ketushubham098,
You’ve shared the code of a different problem(String Sort).
Please share the correct code of the above problem(Counting Sort).
here is the correct code i am getting tle how to counter it what changes are needs to be done in the program
https://discuss.codingblocks.com/u/Mihir.sood i have sent correct code please check and resolve my error
Hey @ketushubham098
You have used bubble sort to solve the problem, so you’re getting a TLE.
The program expects you to sort using count sort.
In count sort, you need count the frequency of each of the elements and then store them. After that you start from the lowest element with non zero frequency and print it’s occurrence while it’s count is not zero.
Try solving the code using count sort
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.