Available question text
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.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1000. Minimum Cost to Merge Stones
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source