Count sort question

my code is not able to pass the test case
answer: https://ide.codingblocks.com/s/126032
question: https://hack.codingblocks.com/app/contests/916/p/437

@dhruvika Consider test case:
6
1 1 3 4 2 1

Your Output:
1 1 1 2 2 1

Expected Output:
1 1 1 2 3 4

Dry Run and check where it goes wrong.