def maxProfit(self, prices):
mn, mx = float("inf"), 0
for i,v in enumerate(prices):
mn, mx = min(mn, v), max(mx, v-mn)
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.