Result

AC

Code [DL]

while read -n1 c;do a[c]+=@;done
for i in {0..9};do echo -n ${a[i]//@/$i};done

stdin

1656368006614762227309142089676045064051954386121313590789699125983868104553498770560891279676033311

stdout

0000000000001111111111112222222333333333344444445555555556666666666666667777777788888888899999999999

stderr

/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

strace