Given n ropes of different lengths, connect them into a single rope with the minimum possible cost. The cost to connect two ropes is equal to the sum of their lengths.
{
"arr": [
4,
3,
2,
6
]
}29{
"arr": [
1,
2,
3,
4,
5
]
}33{
"arr": [
4,
2,
7,
6,
9
]
}62Sign in to Run Code and Submit