#3219
Minimum Cost for Cutting Cake II
candidate master · 1305 · lc hard +32 · 55.2% accepted · 127 likes · top 48%
Description
An m x n cake is to be cut into unit pieces. You are given horizontalCut (size m - 1) and verticalCut (size n - 1) cost arrays. Each cut divides one piece into two at a fixed cost.
Return the minimum total cost to obtain all 1 x 1 pieces.
Code
1
2
3