aboutsummaryrefslogtreecommitdiff
path: root/challenge-327/sgreen/python/ch-1.py
diff options
context:
space:
mode:
authorSimon Green <mail@simon.green>2025-06-29 22:41:39 +1000
committerSimon Green <mail@simon.green>2025-06-29 22:41:39 +1000
commit204693e9ecff8f799dbcf84e3085d68f8537c0ff (patch)
treea23fbca221fb5dfdf2459916f8f396392d51a4f6 /challenge-327/sgreen/python/ch-1.py
parent99d8fa43930abb471fac2b94b68c0785619b37fc (diff)
downloadperlweeklychallenge-club-204693e9ecff8f799dbcf84e3085d68f8537c0ff.tar.gz
perlweeklychallenge-club-204693e9ecff8f799dbcf84e3085d68f8537c0ff.tar.bz2
perlweeklychallenge-club-204693e9ecff8f799dbcf84e3085d68f8537c0ff.zip
sgreen solutions to challenge 327
Diffstat (limited to 'challenge-327/sgreen/python/ch-1.py')
-rwxr-xr-xchallenge-327/sgreen/python/ch-1.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/challenge-327/sgreen/python/ch-1.py b/challenge-327/sgreen/python/ch-1.py
new file mode 100755
index 0000000000..6c52c9dc2f
--- /dev/null
+++ b/challenge-327/sgreen/python/ch-1.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+
+import sys
+
+
+def missing_integers(ints: list) -> list[int]:
+ """Find missing integers in a sequence.
+
+ Args:
+ ints (list): List of integers.
+
+ Returns:
+ list[int]: List of missing integers in the sequence.
+ """
+
+ return [i for i in range(1, len(ints) + 1) if i not in ints]
+
+
+def main():
+ # Convert input into integers
+ array = [int(n) for n in sys.argv[1:]]
+ result = missing_integers(array)
+ print(result)
+
+
+if __name__ == '__main__':
+ main()