Classes
Solution()
Solution
The main idea is just that the find the maximum profit we just store the lowest price and compare this to all the other values
time complexity : \(O(n)\)
space complexity: \(O(1)\)
Table of Contents
Solution.maxProfit()