← 返回 meta 的题目列表Best Time to Buy and Sell Stock
类型:online_judge
Given an integer array prices, where prices[i] is the price of a given stock on the i-th day, design an algorithm to find the maximum profit. You can complete at most two transactions. Note: You may not sell a stock before you buy one.
Example
Input
7
3 3 5 0 0 3 1 4