Doubt in counting sort

Sir this code for all the cases then why does it is showing error ??? for test cases???

Check now.

sir but why it doesnt work when we first declare the array like a[1000000]

instead of first taking taking the size from user and than defining a[size]

both should work isnt it??

Yes it must work according to the constraints.
But the test cases must have N >= 10^6
So make a habit of defining array as a[size]

sir i have submitted the code and also test cases are passed still in the completed section it is not showing tick why??

There must be some technical issue. Submit it again later

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.