id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

rnewton31@gatech.edu ds-attendance > nth_largest
prev  |  next  |  chance

Given a list of numbers, numbers and an integer, n, return the nth largest number in the list, ignoring duplicates. The list of numbers will always contain at least n unique numbers.

Hint: Consider converting numbers into a collection that cannot contain duplicates. Functions located in the helpful functions page of the course may also come in handy here.


nth_largest([1, 1, 1], 1) → 1
nth_largest([1, 2, 3], 2) → 2
nth_largest([1, 2, 3, 4], 3) → 2

...Save, Compile, Run (ctrl-enter)

def nth_largest(numbers, n):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 230

Copyright Nick Parlante 2017 - privacy