SHARE
TWEET

Untitled

mfgnik May 28th, 2020 924 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top