File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/python
2- # -*- coding: utf-8 -*-
3-
41"""
52Source: https://www.instagram.com/p/CG7kv65A6s1/?utm_source=ig_web_copy_link
63The following function accepts 2 positive integers
1916"""
2017
2118
22- def maximum_combination (first_num , second_num ):
19+ def maximum_combination (first_num , second_num ) -> int :
2320 if first_num <= 0 :
2421 return 0
2522 if second_num <= 0 :
2623 return first_num
2724 second_num = [int (x ) for x in str (second_num )]
2825 first_num = [int (x ) for x in str (first_num )]
2926 second_num .sort (reverse = True )
30- for ( index , val ) in enumerate (first_num ):
27+ for index , val in enumerate (first_num ):
3128 if len (second_num ) > 0 :
3229 if second_num [0 ] > val :
3330 first_num [index ] = second_num [0 ]
3431 second_num .pop (0 )
3532 else :
3633 break
37- return int ('' .join (map (str , first_num )))
34+ return int ("" .join (map (str , first_num )))
3835
3936
40- if __name__ == ' __main__' :
37+ if __name__ == " __main__" :
4138 from doctest import testmod
4239
4340 testmod ()
You can’t perform that action at this time.
0 commit comments