aboutsummaryrefslogtreecommitdiff
path: root/challenge-327/sgreen/python/ch-1.py
diff options
context:
space:
mode:
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()