Getting everything ready for you…

Loading courses, problems and your progress. This takes just a moment.

0s

Practice › Arrays

Find the Largest Element in an Array

Easy · Arrays

Problem Statement

Given an array of N integers, find and print the largest element in the array.

Input The first line contains an integer N. The second line contains N space-separated integers.

Output Print the largest element in the array.

Constraints 1 <= N <= 10^5 -10^9 <= A[i] <= 10^9

Example 1

Input

5
3 9 2 11 4

Output

11

Solve Find the Largest Element in an Array online · All practice problems