Smallest Value

When you have a set of numbers, you often need to quickly find the minimum value: a price, score, temperature, or any other measurement. Write find_smallest_int, which takes a non-empty list arr and returns the smallest number in it. The numbers may be positive or negative.

Примеры

Ввод
[78, 56, 232, 12, 8]
Вывод
8
Ввод
[-3, -2, -1, 0]
Вывод
-3
Ввод
[34, 15, 88, 2]
Вывод
2

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

def find_smallest_int(arr: list[int]) -> int:

Теги

arraymath
PostgreSQLv16

Tu sa zobrazí výsledok spustenia kódu

Visible tests
1
Input
[78,56,232,12,8]
Expected8
2
Input
[-3,-2,-1,0]
Expected-3
3
Input
[34,15,88,2]
Expected2
4
Input
[5]
Expected5
5
Input
[0,0,0]
Expected0
6
Input
[0]
Expected0
Focus radio
Paused · SomaFM · Fluid