All tasks
Mediumstringsloops

Digit Frequency

Time limit 2 s · Memory 64 MBAcceptance: —Solved by: 0

Statement

You are given a string of digits (it may be a very large number). Print ten numbers on one line separated by spaces: how many times digit 0 occurs, then digit 1, and so on up to 9.

Examples

Example 1
Input
112233
Output
0 2 2 2 0 0 0 0 0 0
Example 2
Input
9
Output
0 0 0 0 0 0 0 0 0 1

Constraints

  • String length is between 1 and 1000
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.