aboutsummaryrefslogtreecommitdiff
path: root/challenge-263/luca-ferrari/python/ch-1.py
blob: 445b48b0044ecfd138c44b96def9da2825e6055a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!python

#
# Perl Weekly Challenge 263
# Task 1
#
# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-263>
#

import sys

# task implementation
# the return value will be printed
def task_1( args ):
    k      = int( args[ 0 ] )
    nums   = list( map( int, args[ 1: ] ) )
    nums.sort()
    return list( filter( lambda x: nums[ x ] == k, range( 0, len( nums ) ) ) )


# invoke the main without the command itself
if __name__ == '__main__':
    print( task_1( sys.argv[ 1: ] ) )