Driver program to test above function
int main ( ) { int len [ ] = { 4 , 3 , 2 , 6 } ; int size = sizeof ( len ) / sizeof ( len [ 0 ] ) ; cout << " Total ▁ cost ▁ for ▁ connecting ▁ ropes ▁ is ▁ " << minCost ( len , size ) ; return 0 ; }