Files
30-seconds-of-code/test/max_n/max_n.py
Rohit Tanwar 385bf72a3e readme-script
2018-02-20 22:42:11 +05:30

8 lines
140 B
Python

from copy import deepcopy
def max_n(arr, n=1):
numbers = deepcopy(arr)
numbers.sort()
numbers.reverse()
return numbers[:n]