We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
fromfunctoolsimportcmp_to_keydefcompare_big(num1,num2):iflen(num1)>len(num2):return1eliflen(num1)<len(num2):return-1else:ford1,d2inzip(num1,num2):ifd1>d2:return1elifd1<d2:return-1return0defbigSorting(unsorted):returnsorted(unsorted,key=cmp_to_key(compare_big))# Write your code herefrom functools import cmp_to_keydefcompare_big(num1,num2):iflen(num1)>len(num2):return1eliflen(num1)<len(num2):return-1else:ford1,d2inzip(num1,num2):ifd1>d2:return1elifd1<d2:return-1return0defbigSorting(unsorted):returnsorted(unsorted,key=cmp_to_key(compare_big))# Write your code here
B
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
Python3, tried this way
B