JAVA 0MS 100.00% Better Solution
class Solution {\n    public int maximumDifference(int[] nums) {\n        int ans = -1; int min = nums[0]; \n        for(int i=1; i<nums.length; i++){\n        
class Solution {\n    public int maximumDifference(int[] nums) {\n        int ans = -1; int min = nums[0]; \n        for(int i=1; i<nums.length; i++){\n            ans = Math.max(ans,nums[i]-min);\n            min = Math.min(min,nums[i]);\n        }\n        return ans==0?-1:ans;\n    }\n}
['Java']