Search⌘ K
AI Features

Minimum Cost to Connect Sticks

Minimum Cost to Connect Sticks gives an array of positive lengths. Repeatedly combine any two sticks, paying their combined length each time, and return the smallest total cost to leave one stick.

Statement

You are given a set of sticks with positive integer lengths represented as an array, sticks, where ...