Éric Angelini devised this progressively self-inventorying array:

10 71 32 23 14 15 16 27 18 19

20 81 72 53 44 35 26 47 38 29

40 101 82 73 64 65 56 77 58 39

60 131 92 93 74 75 86 107 88 69

80 201 122 113 84 85 96 117 138 89

The first line describes it own contents: it contains one occurrence of the digit 0, seven occurrences of the digit 1, three occurrences of the digit 2, two occurrences of the digit 3, and so on.

In the same style, the second line describes the joint contents of the first and the second lines: they contain two occurrences of the digit 0, eight occurrences of the digit 1, seven occurrences of the digit 2, five occurrences of the digit 3, and so on.

The remaining lines also describe their own contents and that of all previous lines. The fifth line describes the contents of all lines: together they contain eight occurrences of the digit 0, twenty occurrences of the digit 1, twelve occurrences of the digit 2, eleven occurrences of the digit 3, and so on.

He suspects that a six-line self-inventorying array is possible, but he hasn't found one yet.

Assignment

The digit count of string $$s$$ (str) is a tuple containing ten numbers $$(a_0, a_1, \ldots, a_9)$$, with $$a_i \in \mathbb{N}$$ (int) the number of occurrences of digit $$i$$ in $$s$$ ($$i = 0, 1, \ldots, 9$$).

The description of a digit count $$(a_0, a_1, \ldots, a_9)$$ is a string (str) formatted as

$$a_0$$0 $$a_1$$1 $$\ldots$$ $$a_9$$9

Leading zeros in the representation of $$a_i$$i ($$i = 0, 1, \ldots, 9$$) are omitted: if digit 3 does not occur in string $$s$$, then the description of the digit count simply mentions 3 and not 03. Your task:

Example

>>> digit_count('10 71 32 23 14 15 16 27 18 19')
(1, 7, 3, 2, 1, 1, 1, 2, 1, 1)
>>> digit_count('F1gur471v3ly 5p34k1ng?')
(0, 3, 0, 2, 2, 1, 0, 1, 0, 0)

>>> description((1, 7, 3, 2, 1, 1, 1, 2, 1, 1))
'10 71 32 23 14 15 16 27 18 19'
>>> description((0, 3, 0, 2, 2, 1, 0, 1, 0, 0))
'0 31 2 23 24 15 6 17 8 9'

>>> isselfinventorying(['10 71 32 23 14 15 16 27 18 19'])
True
>>> isselfinventorying(['F1gur471v3ly 5p34k1ng?'])
False
>>> isselfinventorying([
...     '10 71 32 23 14 15 16 27 18 19',
...     '20 81 72 53 44 35 26 47 38 29'
... ])
True
>>> isselfinventorying((
...     '10 71 32 23 14 15 16 27 18 19',
...     '20 81 72 53 44 35 26 47 38 29',
...     '40 101 82 73 64 65 56 77 58 39',
...     '60 131 92 93 74 75 86 107 88 69',
...     '80 201 122 113 84 85 96 117 138 89',
... ))
True

>>> isselfinventorying_2('10 71 32 23 14 15 16 27 18 19')
True
>>> isselfinventorying_2('F1gur471v3ly 5p34k1ng?')
False
>>> isselfinventorying_2(
...     '10 71 32 23 14 15 16 27 18 19',
...     '20 81 72 53 44 35 26 47 38 29'
... )
True
>>> isselfinventorying_2(
...     '10 71 32 23 14 15 16 27 18 19',
...     '20 81 72 53 44 35 26 47 38 29',
...     '40 101 82 73 64 65 56 77 58 39',
...     '60 131 92 93 74 75 86 107 88 69',
...     '80 201 122 113 84 85 96 117 138 89',
... )
True

Epilogue

Éric Angelini may stop looking for six-line self-inventorying arrays, as Toon Baeyens from Ghent University was able to demonstrate that such an array does not exist. In addition, he also showed that apart from the five-line self-inventorying array from the introduction, there is only one other such array:

10 71 32 23 14 15 16 27 18 19

20 81 72 53 44 35 26 47 38 29

30 111 82 83 74 45 46 77 68 39

40 151 92 93 94 75 56 117 78 79

60 241 112 113 114 85 76 137 108 89

At least, as long as we restrict ourselves to the decimal number system.