Easy Java Solution
\nclass Solution {\n    public int maximumDifference(int[] nums) {\n        int min = nums[0];\n        int result = -1;\n        for (int i = 1; i<nums.length;
```\nclass Solution {\n    public int maximumDifference(int[] nums) {\n        int min = nums[0];\n        int result = -1;\n        for (int i = 1; i<nums.length; i++)\n        {\n            if (nums[i] > min)\n                result = Math.max(result, nums[i] - min);\n            else\n                min = Math.min(min, nums[i]);\n        }\n        \n        return result;\n    }\n}\n```
['Java']