Connect all sticks into one at the minimum total cost.
Unlock detailed company stats for this questionUpgrade
Given an array arr[] of stick lengths, connect them all into a single stick with the minimum total cost. The cost to connect two sticks is the sum of their lengths, and you can only connect 2 sticks at a time.
Example: arr[] = [4,3,2,6] gives 29.
Format · Technical interview.
Also asked as · Connect n sticks into one with minimum total cost.
Community answers
No answers contributed by the community yet.
Related questions
Minimum Cost to Connect SticksFind the minimum cost to connect ropes into one rope.Find the minimum cost to connect N points on a 2D plane.Related courses

Course

Course
Course

