Counting sort(runtime error)

run time error is showing
problem link:-https://online.codingblocks.com/player/15114/content/7539/4932

soln link: https://ide.codingblocks.com/s/99890
showing correct answer for this case
7
3 5 2 6 1 4 3

but wrong for
5
1 3 2 6 5

@Chetan_Khandelwal hey chetan their is small modification required in your code
here is your modified code
this.

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.