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.
You don't need to convert str to int and back to str. First you sort the list of strings. Then you sort the sorted list with according to length of the strings. Here is the solution in Python 3.6.
foriinsorted(sorted(arr),key=len):print(i)
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Big Sorting
You are viewing a single comment's thread. Return to all comments →
You don't need to convert str to int and back to str. First you sort the list of strings. Then you sort the sorted list with according to length of the strings. Here is the solution in Python 3.6.