title: Minimum Cost Connect Weighted Nodes Represented Array
signature: func minimumCostConnectWeightedNodesRepresentedArray(a []int, n int) int {
source_py: def minimum_cost_connect_weighted_nodes_represented_array(a, n):
      mn = sys.maxsize
      sum = 0
      for i in range(n):
          mn = min(a[i], mn)
          sum += a[i]
      return (mn * (sum - mn))
source_cpp: int minimum_cost_connect_weighted_nodes_represented_array(vector<int> a, int n) {
    int mn = INT_MAX;
    int sum = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      mn = min ( a [ i ], mn );
      sum += a [ i ];
    }
    return mn * ( sum - mn );
  }