Leetcode 3219. Minimum Cost for Cutting Cake II
Given costs for each horizontal and vertical cut needed to split an m×n cake into 1×1 pieces, determine the cut order that minimizes total cost, knowing each cut's cost is incurred once per existing segment in the perpendicular direction. The problem reduces to a greedy scheduling/ordering challenge: choose cuts in descending cost so high-cost cuts are applied when they multiply over fewer segments.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.