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.
unsorted_1 = []
unsorted_2 = []
for i in unsorted:
if len(i) <= 31:
unsorted_1.append(i)
else:
unsorted_2.append(i)
n = len(unsorted_2)
for i in range(n-1, 0, -1):
for j in range(i):
if len(unsorted_2[j]) > len(unsorted_2[i]) or (len(unsorted_2[j]) == len(unsorted_2[i]) and unsorted_2[j] > unsorted_2[i]):
unsorted_2[i], unsorted_2[j] = unsorted_2[j], unsorted_2[i]
return list(map(str, sorted(list(map(int, unsorted_1))))) + unsorted_2
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 →
def bigSorting(unsorted): # Write your code here