From a4beda300a4a06af157d83149b160d7c0995b3e2 Mon Sep 17 00:00:00 2001 From: Yitzchak Scott-Thoennes Date: Mon, 7 Jul 2025 17:49:13 -0400 Subject: challenge 329 task 1 python and perl solutions --- challenge-329/ysth/python/ch-1.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 challenge-329/ysth/python/ch-1.py (limited to 'challenge-329/ysth/python') diff --git a/challenge-329/ysth/python/ch-1.py b/challenge-329/ysth/python/ch-1.py new file mode 100644 index 0000000000..3ec3594967 --- /dev/null +++ b/challenge-329/ysth/python/ch-1.py @@ -0,0 +1,10 @@ +import sys +import re + +inputs = sys.argv[1:] + +for string in inputs: + #new_string = string.translate({ c:' ' for c in range(ord('a'),ord('z')+1) }) + #unique_integers = sorted(set(new_string.split())) + unique_integers = [int(i) for i in sorted(set(re.findall(r'0*(\d+)', string)))] + print(f'{string:<30} -> {str(unique_integers)}') -- cgit