2022-08-20 09:51:37 +02:00
2022-08-20 09:51:37 +02:00
2022-08-20 09:51:37 +02:00

Transform Set of Strings to Common Prefix Notation

Description

Presented with a series of lines on standard input, the program will print an expression on standard output that denotes the line strings in a syntax described in https://tk-sls.de/wp/6071.

The expression is suitable for Bourne Again Shell brace expansion.

Test

$ python3 trie.py << EOF
a
ab
abc
EOF

Expected output:

a{,b{,c}}

Test if the output is accurate:

$ bash -c 'echo a{,b{,c}}'

Expected output:

a ab abc
Description
Transform Set of Strings to Common Prefix Notation
Readme 31 KiB
v2.0 Latest
2022-08-21 11:33:13 +02:00
Languages
Python 75.7%
Shell 24.3%