Similar to Best Time to Buy and Sell Stock[C++]
\nCredit-Subhanshu Babbar\nclass Solution {\npublic:\n    int maximumDifference(vector<int>& prices) {\n        int maxPro = 0;\n    int minPrice = INT_MAX;\n  
```\nCredit-Subhanshu Babbar\nclass Solution {\npublic:\n    int maximumDifference(vector<int>& prices) {\n        int maxPro = 0;\n    int minPrice = INT_MAX;\n    for(int i = 0; i < prices.size(); i++){\n        minPrice = min(minPrice, prices[i]);\n        maxPro = max(maxPro, prices[i] - minPrice);\n    }\n        if(maxPro==0) return -1;\n        return maxPro;\n    \n    }\n};\n```
['C']