You are viewing a single comment's thread. Return to all comments →
A 3-liner solution in Python:
unsorted = [input() for _ in range(int(input()))] x=sorted(unsorted,key=lambda x:(len(x),int(x))) print(*x,sep='\n')
The key is to use a proper key for sorting :)
Big Sorting
You are viewing a single comment's thread. Return to all comments →
A 3-liner solution in Python:
The key is to use a proper key for sorting :)