You are viewing a single comment's thread. Return to all comments →
x=input() print(''.join(sorted(x,key=lambda x:(x.isdigit() and int(x)%2==0,x.isdigit() and int(x)%2!=0,x.isupper(),x.islower(),x))))
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
ginortS
You are viewing a single comment's thread. Return to all comments →
x=input() print(''.join(sorted(x,key=lambda x:(x.isdigit() and int(x)%2==0,x.isdigit() and int(x)%2!=0,x.isupper(),x.islower(),x))))