[Python3] Easiest O(n), O(1) space
\n    def maximumDifference(self, nums: List[int]) -> int:\n        minimal = nums[0]\n\t\t# assign result as -1\n        res = -1\n        for n in nums[1:]:\n
```\n    def maximumDifference(self, nums: List[int]) -> int:\n        minimal = nums[0]\n\t\t# assign result as -1\n        res = -1\n        for n in nums[1:]:\n\t\t    # if current number is less than our minimal assign it to minimal\n            if n <= minimal:\n                minimal = n\n            else:\n\t\t\t    # if current number was not minimal check if difference would be bigger than we have\n                res = max(res, n-minimal)\n        return res\n```
[]