Maximum Difference Between Increasing Elements Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\npublic:\n    int maximumDifference(vector<int>& nums) {\n        int i=0, j, max=-1;\n        for(j=1 ; j<nums.size() ; j++)\n        {\n            if(nums[i]<nums[j] && (nums[j]-nums[i])>max)\n            {\n                max = nums[j]-nums[i];\n            }\n            else if(nums[i]>=nums[j])\n            {\n                i = j;\n            }\n        }\n        return max;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/1e09db02-0cc7-4c76-8fb2-8eb2189c501f_1682915776.1077867.jpeg)\n
['C++']