Description
Submission
class Solution { public: int maximumDifference(vector<int>& nums) { int minElement = INT_MAX; int ret = -1; for(int x: nums) { if(minElement < x) ret = max(ret, x - minElement); minElement = min(x, minElement); } return ret; } };