Given a non-empty array of integers nums, return the largest value in the array.
Example 1: Input: nums = [3,1,4,1,5] Output: 5
Example 2: Input: nums = [-8,-2,-9] Output: -2
Constraints: 1 <= nums.length <= 100 -1000 <= nums[i] <= 1000
Given a non-empty array of integers nums, return the largest value in the array.
Example 1: Input: nums = [3,1,4,1,5] Output: 5
Example 2: Input: nums = [-8,-2,-9] Output: -2
Constraints: 1 <= nums.length <= 100 -1000 <= nums[i] <= 1000
Copyright 2026 algowars. All rights reserved.
Input 1 (integer_array)
[3,1,4,1,5]
Output 1 (integer)
5