Fetching data...
This may take a moment
Back
2426. Maximum Profit From Trading Stocks
Medium
Array
Dynamic Programming
Solve on LeetCode
View Solutions
Description
Hints
Hint 1
Think of the 0-1 Knapsack Problem.
Hint 2
For the ith stock, the weight is present[i], and the value is future[i] - present[i].
Similar Questions
Best Time to Buy and Sell Stock
Easy
Best Time to Buy and Sell Stock II
Medium
Best Time to Buy and Sell Stock III
Hard
Best Time to Buy and Sell Stock IV
Hard
Statistics
Acceptance
47.6%
Submissions
34,958
Accepted
16,637