java brute force approach
class Solution {\n    public int maximumDifference(int[] arr) {\n        int max=-1;\n        for(int i=0;iarr[i] && ((arr[j]-arr[i])>max))\n                {\n
# class Solution {\n    public int maximumDifference(int[] arr) {\n        int max=-1;\n        for(int i=0;i<arr.length-1;i++)\n        {\n            for(int j=i+1;j<arr.length;j++)\n            {\n                if(arr[j]>arr[i] && ((arr[j]-arr[i])>max))\n                {\n                    max=arr[j]-arr[i];\n                }\n            }\n        }\n        return max;\n    }\n}
['Java']