title: Minimum Sum Two Numbers Formed Digits Array
signature: function minimum_sum_two_numbers_formed_digits_array(arr, n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(arr, n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(arr, n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver([3, 4, 5, 10, 14, 16, 18, 42, 43, 43, 45, 46, 51, 52, 53, 58, 61, 66, 79, 81, 82, 84], 19, 4183488835);
      @printf("TEST-0...%s\n",result);
      
      result = driver([-90, -86, -76, -50, -46, -30, -26, -22, -22, -20, -2, -2, 8, 22, 32, 40, 48, 48, 56, 58, 60, 76, 82, 82, 94, 98], 25, -107220607602444);
      @printf("TEST-1...%s\n",result);
      
      result = driver([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 23, 1222222);
      @printf("TEST-2...%s\n",result);
      
      result = driver([45, 79], 1, 45);
      @printf("TEST-3...%s\n",result);
      
      result = driver([-90, -68, -38, -34, -4, 6, 10, 28, 48, 52, 54, 68, 88, 90], 11, -10095534);
      @printf("TEST-4...%s\n",result);
      
      result = driver([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], 22, 122222);
      @printf("TEST-5...%s\n",result);
      
      result = driver([4, 8, 8, 23, 26, 27, 30, 42, 44, 55, 59, 64, 67, 69, 74, 77, 82, 82, 87, 96, 97], 17, 615688689);
      @printf("TEST-6...%s\n",result);
      
      result = driver([-98, -98, -86, -82, -76, -76, -66, -64, -62, -60, -48, -46, -42, -36, -36, -32, -28, -18, -18, -4, 0, 0, 2, 4, 10, 18, 30, 46, 50, 52, 62, 70, 72, 76, 80, 88, 88, 94, 96], 32, -214463225281903248);
      @printf("TEST-7...%s\n",result);
      
      result = driver([0, 0, 0, 0, 0, 0, 1, 1, 1, 1], 6, 0);
      @printf("TEST-8...%s\n",result);
      
      result = driver([7, 8, 9, 9, 14, 14, 16, 17, 22, 24, 32, 32, 36, 38, 42, 42, 43, 45, 47, 53, 54, 56, 58, 58, 61, 63, 64, 68, 69, 69, 71, 71, 71, 72, 73, 74, 75, 82, 86, 86, 87, 90, 96, 97, 98], 25, 8964536953959);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def minimum_sum_two_numbers_formed_digits_array(arr, n):
      arr.sort()
      a = 0
      b = 0
      for i in range(n):
          if ((i % 2) != 0):
              a = ((a * 10) + arr[i])
          else:
              b = ((b * 10) + arr[i])
      return (a + b)
source_cpp: int minimum_sum_two_numbers_formed_digits_array(vector<int> arr, int n) {
    sort(arr.begin(), arr.end());
    int a = 0, b = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      if ( i & 1 ) a = a * 10 + arr [ i ];
      else b = b * 10 + arr [ i ];
    }
    return a + b;
  }