maxGain
- that returns the maximum gain. Maximum Gain is defined as the maximum difference between 2 elements in a list such that the larger element appears after the smaller element. If no gain is possible, return 0.public static int maxGain(int[] a) { }
C
Java
Python