952. Find the Smallest Element in an Array
Given an array of integers arr, return the smallest element present in the array.
Example 1:
Input: arr = [2, 5, 1, 3, 0]
Output: 0
Explanation: 0 is the smallest element in the array.
Example 2:
Input: arr = [8, 10, 5, 7, 9]
Output: 5
Explanation: 5 is the smallest element in the array.
Now Your Turn!
Pick the correct output for the given inputInput: arr = [-3, -1, -7, -2]
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 1 <= arr.length <= 105
- -109 <= arr[i] <= 109