Java: short, easy to read, faster than 100%
\npublic int maximumDifference(int[] nums) {\n        int min     = Integer.MAX_VALUE;\n        int maxGain = 0;\n        for (int num:nums){\n            if (n
```\npublic int maximumDifference(int[] nums) {\n        int min     = Integer.MAX_VALUE;\n        int maxGain = 0;\n        for (int num:nums){\n            if (num<min) min=num;\n            else if(maxGain<num-min) maxGain=num-min;\n        }\n        return maxGain==0?-1:maxGain;\n}\n```
[]