4 ms·
Further to my reply to sibling-reply finnw, here's the pattern of digits, further showing his 10 * 9, etc., breakdown. $ pins | > sed -r ' > :a
by ralph 14y ago
Further to my reply to sibling-reply finnw, here's the pattern of digits, further showing his 10 * 9, etc., breakdown.
$ pins |
> sed -r '
> :a; s/^([0-9])(.*)\1/\1\2a/; ta; s/[0-9]/a/
> :b; s/a([0-9])(.*)\1/a\1\2b/; tb; s/[0-9]/b/
> s/([0-9])\1/cc/; s/[0-9]/c/
> s/[0-9]/d/
> ' |
> sort | uniq -c | sort -n
10 aaaa
90 aaab
90 aaba
90 aabb
90 abaa
90 abab
90 abba
90 abbb
720 aabc
720 abac
720 abbc
720 abca
720 abcb
720 abcc
5040 abcd
$