划分区间类

state: f[i] 表示前 i 个元素的最大/小 值
function: f[i] = 前 i 个元素里面选一个区间的最值

题目

53. Maximum Subarray

152. Maximum Product Subarray

121. Best Time to Buy and Sell Stock

309. Best Time to Buy and Sell Stock with Cooldown

123. Best Time to Buy and Sell Stock III

188. Best Time to Buy and Sell Stock IV