Learn
Exam

Find the Minimum Value in an Array

Difficulty
STARTER

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 numbers is an integer with an absolute value not exceeding 500.
  • numbers is 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 numbers is 0.

Explanation for Test Case 2

  • The smallest value in numbers is 497.

Explanation for Test Case 3

  • The smallest value in numbers is -20.