Max

Easy

Given an array of integers, return the integer with the largest value.

Parameter(s):

  • arr: array of integers

Returns:

  • integer: the maximum value

Constraints:

  • arr ≠ null
  • 1 ≤ arr.length ≤ 100
  • -2147483647 ≤ arr[i] ≤ 2147483647

Example:

Input:

[2,5,1,4,3]

Output:

5