Minimum sum by choosing minimum of pairs from array | Returns minimum possible sum in array B [ ] ; driver function
function minSum ( A , n ) { let min_val = Math . min ( ... A ) ; return ( min_val * ( n - 1 ) ) ; } let A = [ 3 , 6 , 2 , 8 , 7 , 5 ] ; let n = A . length ; document . write ( minSum ( A , n ) ) ;