I read the post of @dietpepsi . It's a great post but I think the explanation is a little bit complex. We could just take dp[left][right] as the coins we got after burst all balloons between left and right (exclusive).

Thus, dp[left][right] = nums[left] * nums[k] * nums[right] + dp[left][k] + dp[k][right]