Problem Statement
You are given an array of integers. Your task is to find the maximum value of: arr[j] - arr[i] where j > i (the larger element must come after the smaller element in the array) In other words: choose two positions in the array where the second number comes later, and compute the difference. Output the largest difference you can get.
Example
Input:
5
7 1 5 3 6
Output:
5
(6 - 1 = 5)