
121. Best Time to Buy and Sell Stock
·
Algorithm
leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1. 선형 탐색 class Solution: def maxProfit(self, prices: List[int]) -> int: min_val, profit = prices[0], 0 for price in prices: min_val = min(min_val..