Value Spread

The difference between the largest and smallest values shows how widely the numbers in a list are spread out. Write a function big_diff that takes a non-empty list nums. Find the largest and smallest numbers, then return the difference between them.

Примеры

Ввод
[10, 3, 5, 6]
Вывод
7
Ввод
[7, 2, 10, 9]
Вывод
8
Ввод
[2, 10, 7, 2]
Вывод
8

Нужно реализовать

def big_diff(nums: list[int]) -> int:

Теги

listsarray
PostgreSQLv16

Tutaj pojawi się wynik wykonania kodu

Visible tests
1
Input
[10,3,5,6]
Expected7
2
Input
[7,2,10,9]
Expected8
3
Input
[2,10,7,2]
Expected8
4
Input
[2,10]
Expected8
5
Input
[5]
Expected0
6
Input
[10]
Expected0
Focus radio
Paused · SomaFM · Fluid