Range Edges
Write a function min_max that takes a non-empty list lst and returns a list of two elements: the minimum and maximum numbers. If the list has one element, it is both the minimum and the maximum. The min() and max() functions will help.
Примеры
Ввод
[1, 2, 3, 4, 5]Вывод
[1, 5]Ввод
[2334454, 5]Вывод
[5, 2334454]Ввод
[1]Вывод
[1, 1]Нужно реализовать
def min_max(lst: list[int]) -> list[int]:
Теги
listsarraymath
Συνδεθείτε για να δείτε το ιστορικό υποβολών
ΣύνδεσηΣυνδεθείτε για να χρησιμοποιήσετε τον AI Mentor
ΣύνδεσηTests12
Visible tests
Κρυφό τεστ 7
Κρυφό τεστ 8
Κρυφό τεστ 9
Κρυφό τεστ 10
Κρυφό τεστ 11
Κρυφό τεστ 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid