why is the answer wrong?
and why is there run error
Sorting in linear time
@Vibhuti0206 there are few error in your code. Also, the logic that you applied doesn’t seem right.For eg : in line number 16 and 20 you’re checking that the mid elements of the array are 1 or 2, but what if there is neither 1 nor 2 in your array. I would recommend you to go through the Count Sort topic to get the idea of the question. If the problem still persists, let me know, I will share the code with you.
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.