From 59481daad96eaa27bd9c4ecd81010941285c496e Mon Sep 17 00:00:00 2001 From: Simon Green Date: Sun, 26 Nov 2023 22:22:13 +1100 Subject: Simon's solution to challenge 244 --- challenge-244/sgreen/python/ch-1.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 challenge-244/sgreen/python/ch-1.py (limited to 'challenge-244/sgreen/python/ch-1.py') diff --git a/challenge-244/sgreen/python/ch-1.py b/challenge-244/sgreen/python/ch-1.py new file mode 100755 index 0000000000..230798c214 --- /dev/null +++ b/challenge-244/sgreen/python/ch-1.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python3 + +import sys + + +def main(ints): + solution = [sum(1 for j in ints if j < i) for i in ints] + print(*solution, sep=', ') + + +if __name__ == '__main__': + # Convert input into integers + array = [int(n) for n in sys.argv[1:]] + main(array) -- cgit