Skip to content
Onsite

Minimum in Array

EasyP3Coding

Return the smallest element of nums.

Example 1

Input
nums = [3,9,2]
Output
2

Example 2

Input
nums = [5]
Output
5

Example 3

Input
nums = [-5,-1,-9]
Output
-9

Constraints

  • 1 <= nums.length <= 10^5
  • -10^9 <= nums[i] <= 10^9

Hints

Run checks the 3 visible tests, Submit all 10.