Advertisement
mfgnik

Untitled

May 28th, 2020
1,039
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. from functools import cmp_to_key
  2.  
  3.  
  4. def compare(lhs, rhs):
  5.     return int(rhs + lhs) - int(lhs + rhs)
  6.  
  7.  
  8. size = int(input())
  9. numbers = [input() for _ in range(size)]
  10. numbers.sort(key=cmp_to_key(compare))
  11. print(''.join(numbers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement