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.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  1. Practice
  2. Python
  3. Basic Data Types
  4. Find the Runner-Up Score!
  5. Discussions

Find the Runner-Up Score!

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

    You are viewing a single comment's thread. Return to all comments →

  • bONSPARROW 2 years ago+ 0 comments

    you cannot be sure about that. set returns unordered collection of unique elements from the iterable. we cannot be sure about the output of set() as it is unordered and need not be sorted. sorted() is required to return a sorted list from the unordered set. maybe it worked for you but it cannot be guaranteed to work everytime. the list() function is redundant as sorted() returns a list itself.

    2|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature