Search
⌘K

Leetcode 122. Best Time to Buy and Sell Stock II

Given daily stock prices, compute the maximum profit you can achieve with unlimited buy/sell operations while holding at most one share at a time (you may buy and sell on the same day). The optimal strategy is to capture every upward price movement, i.e., sum all positive consecutive day-to-day gains.

Asked at:

Oracle


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late January, 2026

Oracle

Senior

Comments

Your account is free and you can post anonymously if you choose.