LeetCode 121: Best Time To Buy And Sell Stock — Step-by-Step Visual Trace
Easy — Array | Dynamic Programming | Greedy
The Problem
Find the maximum profit you can achieve by buying a stock on one day and selling it on a later day. You can only complete at most one transaction (buy once and sell once).
Approach
Use a single ...
blog.tracelit.dev1 min read