We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
s=input()letters=list()numbers=list()forchins:ifch.isdigit():numbers.append(ch)else:letters.append(ch)letters=sorted(letters)numbers=sorted(numbers)# Numbers sorting accordingly odd first even nextfinalNumbers=[nforninnumbersifint(n)%2!=0]+[nforninnumbersifint(n)%2==0]# letters sorting accordingly uppercase letters afterwards and lowercase letters beforefinalLetters=[chforchinlettersifch!=ch.upper()]+[chforchinlettersifch==ch.upper()]# Final listprint("".join(finalLetters+finalNumbers))
Cookie support is required to access HackerRank
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 →