EasyArray· 63% acceptance
#1

Find Maximum Element 1

Easy

Given an integer array `nums` of length 6, return the largest value in the array. This is variant **#1** — arrays may include negative numbers.

Example 1

Input: nums = [-17,-10,-3,4,11,18]

Output: 18

Constraints

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

Acceptance: 63% · Topics: array, iteration

findMax

← All practice problems