Below is my code for TSORT. I checked it multiple times and looks good, but still I get “wrong answer”. Please help!!
=====
#include <stdio.h>
int main(void)
{
unsigned int array[1000001] = {0};
unsigned int t;
unsigned int value = 0;
char temp=0;
scanf("%d",&t);
while(t) {
scanf("%d",&value);
array[value] = array[value] + 1;
t--;
}
t = 0;
while(t<=1000000) {
if(array[t] >= 1) {
for(temp=1; temp<=array[t]; temp++) {
printf("%d\n",t);
}
}
t++;
}
return 0;
}