Python3 beats 93.61% with comments
python\nclass Solution:\n    def maxProfit(self, prices: List[int]) -> int:\n        # Max profit and price to buy\n        max_profit = 0\n        high_buy = 0
```python\nclass Solution:\n    def maxProfit(self, prices: List[int]) -> int:\n        # Max profit and price to buy\n        max_profit = 0\n        high_buy = 0\n        \n        # Reverse the array of prices\n        prices = prices[::-1]\n        \n        # Check each price to sell at compared to the highest buy price ahead of it\n        for price in prices:\n            # Update highest buy price in front of price\n            if price > high_buy:\n                high_buy = price\n            # Check if this sale make higher profit than sales later in original array\n            if high_buy - price > max_profit:\n                max_profit = high_buy - price\n                \n        # Return the highest profit achieved\n        return max_profit\n```\n
['Dynamic Programming', 'Python', 'Python3']