diff options
| author | Simon Green <mail@simon.green> | 2022-11-17 22:50:07 +1100 |
|---|---|---|
| committer | Simon Green <mail@simon.green> | 2022-11-17 22:50:07 +1100 |
| commit | 8203bca3a019823f328b70720bf4168b9eefc5d3 (patch) | |
| tree | 3f70ab43da46ad784b72204f7ce2d1ec07ed19fd /challenge-191/sgreen/python/ch-1.py | |
| parent | 0df63088f99a782b77e5661449ec508ab5940035 (diff) | |
| download | perlweeklychallenge-club-8203bca3a019823f328b70720bf4168b9eefc5d3.tar.gz perlweeklychallenge-club-8203bca3a019823f328b70720bf4168b9eefc5d3.tar.bz2 perlweeklychallenge-club-8203bca3a019823f328b70720bf4168b9eefc5d3.zip | |
Simon's solution to challenge 191
Diffstat (limited to 'challenge-191/sgreen/python/ch-1.py')
| -rwxr-xr-x | challenge-191/sgreen/python/ch-1.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/challenge-191/sgreen/python/ch-1.py b/challenge-191/sgreen/python/ch-1.py new file mode 100755 index 0000000000..38e9b0b853 --- /dev/null +++ b/challenge-191/sgreen/python/ch-1.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 + +import sys + + +def main(s): + # Sort the list numerically + nums = [int(x) for x in s] + nums.sort() + + print(1 if nums[-1] > 2 * nums[-2] else -1) + + +if __name__ == '__main__': + main(sys.argv[1:]) |
