You are viewing a single comment's thread. Return to all comments →
Four decent solutions:
print(*sorted(input(), key=lambda c: (-ord(c) >> 5, c in '02468', c)), sep='') print(*sorted(input(), key=lambda c: (c.isdigit() - c.islower(), c in '02468', c)), sep='') order = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1357902468' print(*sorted(input(), key=order.index), sep='') import string print(*sorted(input(), key=(string.ascii_letters + '1357902468').index), sep='')
Seems like cookies are disabled on this browser, please enable them to open this website
ginortS
You are viewing a single comment's thread. Return to all comments →
Four decent solutions: