Problem
Given an array numbers of integer elements, write a function solution that returns the smallest value among the elements in numbers.
Constraints
- Each element in
numbersis an integer with an absolute value not exceeding 500. numbersis not empty, and its length does not exceed 100.
Test Case
| Test Case Number | numbers | return |
|---|---|---|
| 1 | [0, 1, 2, 3] | 0 |
| 2 | [500, 499, 498, 497] | 497 |
| 3 | [3, -1, 0, 489, 50, -20, 122] | -20 |
Explanation for Test Case 1
- The smallest value in
numbersis0.
Explanation for Test Case 2
- The smallest value in
numbersis497.
Explanation for Test Case 3
- The smallest value in
numbersis-20.