aboutsummaryrefslogtreecommitdiff
path: root/challenge-332/ysth/python/ch-2.py
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-332/ysth/python/ch-2.py')
-rw-r--r--challenge-332/ysth/python/ch-2.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/challenge-332/ysth/python/ch-2.py b/challenge-332/ysth/python/ch-2.py
new file mode 100644
index 0000000000..5a497f5f14
--- /dev/null
+++ b/challenge-332/ysth/python/ch-2.py
@@ -0,0 +1,14 @@
+import sys
+import regex
+
+def odd_letters(string: str) -> bool:
+ return not regex.search(r'(\pL)(?<!\1\1)(?:\1\1)*+(?=\1)', ''.join(sorted(string)))
+
+def main() -> None:
+ inputs: list[str] = sys.argv[1:]
+
+ for string in inputs:
+ print(f'{string:<30} -> {odd_letters(string)}')
+
+if __name__ == '__main__':
+ main()