LeetCode
Minimum Cost to Merge Stones
Click
here
for an explanation.