Array Minimum

EasyArray

Description

Given a non-empty array of integers nums, return the smallest value.

Examples

Input:nums = [3,1,4,1,5]
Output:1
Explanation:

The smallest value present in the list is 1.

Input:nums = [-7,-2,-9]
Output:-9
Explanation:

The smallest value present in the list is -9.

Input:nums = [42]
Output:42
Explanation:

The smallest value present in the list is 42.

Constraints

  • 1 ≤ nums.length ≤ 10⁴
  • -10⁹ ≤ nums[i] ≤ 10⁹

Ready to solve this problem?

Practice solo and sharpen your skills for technical interviews.