⚙️AlgorithmAdvanced
Convex Hull Trick (CHT)
The Convex Hull Trick (CHT) speeds up dynamic programs where each state is a minimum over linear functions, such as dp[i] = min_j (dp[j] + b[j] × a[i]).
#convex hull trick#cht#dynamic programming optimization+12