Maximum of an Array
Given a list of integers, print the largest one.
Input: the first line has an integer N (1 ≤ N ≤ 105). The second line has N integers (−109 ≤ ai ≤ 109) separated by spaces.
Output: the maximum value.
Sample Tests
Input 1
5 1 5 2 4 3
Output 1
5
Input 2
3 -7 -2 -9
Output 2
-2
Discussion (opens after you solve — no spoilers before)
No comments yet.