SDE Path

Find the Largest Element

Easy

Find the Largest Element

Given an array of integers, return the largest element in a single traversal.

Input format

The first line contains N. The second line contains N space-separated integers.

Output format

Print a single integer — the largest element of the array.

Constraints

  • Values fit in a 64-bit signed integer
  • Trailing whitespace and a trailing newline are ignored by the judge

Read from stdin, write to stdout. Sample cases below show the exact format.

Sample cases

Example 1
Input
5
3 9 2 9 1
Expected output
9
Example 2
Input
1
-7
Expected output
-7