Easy solution without syntax sugar [Swift]
\n# Code\n\nclass Solution {\n    func maximumDifference(_ nums: [Int]) -> Int {\n        var result = [Int]()\n    \n        for i in 0..<nums.count {\n       
\n# Code\n```\nclass Solution {\n    func maximumDifference(_ nums: [Int]) -> Int {\n        var result = [Int]()\n    \n        for i in 0..<nums.count {\n            for j in (i + 1)..<nums.count {\n                let diff = nums[j] - nums[i]\n                if diff > 0 { result.append(diff) }\n            }\n        }\n    \n        return result.max() ?? -1\n    }\n}\n```
['Swift']