All Problems

Best Time to Sell Stocks II

MediumarrayExpected: O(n) time, O(1) spaceInterview Context

Problem

Given an array of stock prices, find the maximum profit by buying and selling multiple times.

Loading...