Array Maximum
EasyArray
Description
Given a non-empty array of integers nums, return the largest value.
Examples
Input:
nums = [3,1,4,1,5]Output:
5Explanation:
The largest value present in the list is 5.
Input:
nums = [-7,-2,-9]Output:
-2Explanation:
The largest value present in the list is -2.
Input:
nums = [42]Output:
42Explanation:
The largest value present in the list is 42.
Constraints
- •
1 ≤ nums.length ≤ 10⁴ - •
-10⁹ ≤ nums[i] ≤ 10⁹