blob: a9e1b1472d358b5562bcd1873fcf4973f8afc194 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!python
#
# Perl Weekly Challenge 261
# Task 2
#
# See <https://perlweeklychallenge.org/blog/perl-weekly-challenge-261>
#
import sys
# task implementation
# the return value will be printed
def task_2( args ):
start = int( args[ 0 ] )
nums = args[ 1: ]
while len( list( filter( lambda x: x == str( start ), nums ) ) ) > 0:
start *= 2
return start
# invoke the main without the command itself
if __name__ == '__main__':
print( task_2( sys.argv[ 1: ] ) )
|