Problem Submissions Solution

Minimum Cost of Ropes

Difficulty: Medium

Acceptance: %

Points: 30.00

Given an array arr[] representing the lengths of ropes, the goal is to combine all the ropes into a single rope with the minimum total cost. The cost of connecting two ropes is equal to the sum of their lengths.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n log n)

Expected Auxiliary Space: O(n)

Constraints:
  • 1 <= arr.size() <= 10^5
  • 1 <= arr[i] <= 10^6
Companies:
Amazon Microsoft Goldman Sachs
Topics:
Queue
Locked Content
Access Restricted: Please Login to access the code editor and test cases.