Given an array of integers, find the maximum difference between any two elements such that the larger
Fantastic news! We've Found the answer you've been seeking!
Question:
Given an array of integers, find the maximum difference between any two elements such that the larger element appears after the smaller element.
Example: Input: [7, 9, 5, 6, 3, 2] Output: 2 (difference between 7 and 9)
Related Book For
Statistics For The Behavioral Sciences
ISBN: 9781111830991
9th Edition
Authors: Frederick J Gravetter, Larry B. Wallnau
Posted Date: