NeetCode #108LC-122MediumArrays & HashingNC 250
← Back to All Problems#108 · #122 · Best Time to Buy and Sell Stock II(买卖股票的最佳时机 II)
📌 Problem Statement & Constraints
You are given an array
prices where prices[i] is the price of a stock on day i. You may complete as many transactions as you like (buy one and sell one share multiple times), but you may not hold more than one share at a time. Return the maximum profit. Constraints: 1 <= prices.length <= 3 * 10^4, 0 <= prices[i] <= 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!