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.
Just a small detail, there is no need to convert the set into list if you are going to use the sorted method, you can simple use sorted(set(iterable)).
sorted(): Return a new sorted list from the items in iterable.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Climbing the Leaderboard
You are viewing a single comment's thread. Return to all comments →
Just a small detail, there is no need to convert the set into list if you are going to use the sorted method, you can simple use sorted(set(iterable)).
sorted(): Return a new sorted list from the items in iterable.