Company: opentext_16oct
Difficulty: medium
Maximum Difference with Order Problem Description Given a list of N integers, output the maximum difference of two elements where the large number appears after the smaller number. Input: The first line of the input consists of an integer - inputArr_size , representing the size of the list (N). The second line of the input consists of N space-separated integers - inputArr , representing the elements of the given list. Output: Print an integer representing the maximum difference between two elements. If such a solution can't be found, then print 0. Examples Example 1: Input: 7 2 3 10 6 4 8 1 Output: 8 Explanation: The difference between 2 and 10 is 8. We can't consider 10 and 1 because the large number (10) does not appear after the smaller number (1). So, the output should be 8. Constraints 0 < inputArr_size < 10 3 -10 5 ≤ inputArr[i] ≤ 10 5 ; Where i representing the index of the inputArr . 0 ≤ i < inputArr_size