diff options
Diffstat (limited to 'challenge-256/luca-ferrari/python/ch-1.python')
| -rw-r--r-- | challenge-256/luca-ferrari/python/ch-1.python | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/challenge-256/luca-ferrari/python/ch-1.python b/challenge-256/luca-ferrari/python/ch-1.python new file mode 100644 index 0000000000..e8456319db --- /dev/null +++ b/challenge-256/luca-ferrari/python/ch-1.python @@ -0,0 +1,26 @@ +#!python + +# +# Perl Weekly Challenge 256 +# Task 1 +# +# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-256> +# + +import sys + +# task implementation +# the return value will be printed +def task_1( args ): + max = 0 + for w in args: + count = len( list( filter( lambda rw: rw == ''.join( reversed( w ) ), args ) ) ) + if count > max: + max = count + + return max + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_1( sys.argv[ 1: ] ) ) |
