C++ Very Simple Approach || O(N) time || single iteration
\t\tint ans = 0,mini = nums[0],diff =0;\n        for(int i=1;i<nums.size(); i++)\n        {\n            int a = nums[i];\n            mini = min(a,mini);\n    
\t\tint ans = 0,mini = nums[0],diff =0;\n        for(int i=1;i<nums.size(); i++)\n        {\n            int a = nums[i];\n            mini = min(a,mini);\n            diff = a-mini;\n            ans = max(ans,diff);\n        }\n        if(ans<=0)return -1;\n        return ans;\n\t\t\n\t\t\n\t\t\n****upvote if you find it helpfull****
['Array', 'C']