Minimum sum by choosing minimum of pairs from array | C # program to minimize the cost of array minimization ; Returns minimum possible sum in array B [ ] ; Driver Code
using System ; using System . Linq ; public class GFG { static int minSum ( int [ ] A , int n ) { int min_val = A . Min ( ) ; return ( min_val * ( n - 1 ) ) ; } static public void Main ( ) { int [ ] A = { 3 , 6 , 2 , 8 , 7 , 5 } ; int n = A . Length ; Console . WriteLine ( minSum ( A , n ) ) ; } }