Minimum sum by choosing minimum of pairs from array | Returns minimum possible sum in array B [ ] ; Driver Code
< ? php function minSum ( $ A , $ n ) { $ min_val = min ( $ A ) ; return ( $ min_val * ( $ n - 1 ) ) ; } $ A = array ( 3 , 6 , 2 , 8 , 7 , 5 ) ; $ n = count ( $ A ) ; echo minSum ( $ A , $ n ) ; ? >