Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 1000. Minimum Cost to Merge Stones
Given n piles where you can repeatedly merge exactly k consecutive piles at cost equal to their sum, compute the minimum total cost to merge all piles into one (or return -1 if impossible — possible only when (n-1) % (k-1) == 0). This is typically solved with interval dynamic programming that computes the minimum cost to reduce subarrays to a certain number of piles.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.