โ† Amazon questions

Find minimum cost of joining n rods

Filed under Amazon

Given an array of lengths of n rods, connect all the rods into a single rod. The cost to connect two rods is equal to the sum of their lengths. Find the minimum total cost to connect all rods.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.