From 204693e9ecff8f799dbcf84e3085d68f8537c0ff Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 29 Jun 2025 22:41:39 +1000 Subject: sgreen solutions to challenge 327 --- challenge-327/sgreen/python/ch-1.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 challenge-327/sgreen/python/ch-1.py (limited to 'challenge-327/sgreen/python/ch-1.py') 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() -- cgit