Minimum Cost to Cut a Stick
Given a stick of length n and an array of integer positions representing the positions where the stick is to be cut, find the minimum total cost of cutting the stick at those positions. The cost of cutting the stick at position p is the sum of the lengths of the two resulting sticks.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)