diff options
| author | Mohammad S Anwar <Mohammad.Anwar@yahoo.com> | 2020-09-15 07:49:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-15 07:49:33 +0100 |
| commit | 38f6d006de1fbb226fee0b273bbfb9e766aa76b4 (patch) | |
| tree | 838f0cdc7629cf7da79b4b8afccebf37a738e5d6 /challenge-078/walt-mankowski/python/ch-1.py | |
| parent | 0af76fecc34594e0df626cbef22bb26112e6bdeb (diff) | |
| parent | 9467640e2c7b6e28ddb8b3babc2b39442aeb9b68 (diff) | |
| download | perlweeklychallenge-club-38f6d006de1fbb226fee0b273bbfb9e766aa76b4.tar.gz perlweeklychallenge-club-38f6d006de1fbb226fee0b273bbfb9e766aa76b4.tar.bz2 perlweeklychallenge-club-38f6d006de1fbb226fee0b273bbfb9e766aa76b4.zip | |
Merge pull request #2296 from waltman/branch-for-challenge-078
Branch for challenge 078
Diffstat (limited to 'challenge-078/walt-mankowski/python/ch-1.py')
| -rw-r--r-- | challenge-078/walt-mankowski/python/ch-1.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-078/walt-mankowski/python/ch-1.py b/challenge-078/walt-mankowski/python/ch-1.py new file mode 100644 index 0000000000..48fa69fb88 --- /dev/null +++ b/challenge-078/walt-mankowski/python/ch-1.py @@ -0,0 +1,12 @@ +from sys import argv + +a = [int(x) for x in argv[1:]] +best = None +out = [] + +for i in range(len(a)-1, -1, -1): + if best is None or a[i] > best: + out.insert(0, a[i]) + best = a[i] + +print(out) |
