title: Minimum Sum Two Numbers Formed Digits Array
signature: class Solution {
  
      public Long minimumSumTwoNumbersFormedDigitsArray(ArrayList<Integer> arr, Integer n) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: minimumSumTwoNumbersFormedDigitsArray
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 4183488835, "inputs": {"arr": [3, 4, 5, 10, 14, 16, 18, 42, 43, 43, 45, 46, 51, 52, 53, 58, 61, 66, 79, 81, 82, 84], "n": 19}}, {"idx": 1, "outputs": -107220607602444, "inputs": {"arr": [-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], "n": 25}}, {"idx": 2, "outputs": 1222222, "inputs": {"arr": [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], "n": 23}}, {"idx": 3, "outputs": 45, "inputs": {"arr": [45, 79], "n": 1}}, {"idx": 4, "outputs": -10095534, "inputs": {"arr": [-90, -68, -38, -34, -4, 6, 10, 28, 48, 52, 54, 68, 88, 90], "n": 11}}, {"idx": 5, "outputs": 122222, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], "n": 22}}, {"idx": 6, "outputs": 615688689, "inputs": {"arr": [4, 8, 8, 23, 26, 27, 30, 42, 44, 55, 59, 64, 67, 69, 74, 77, 82, 82, 87, 96, 97], "n": 17}}, {"idx": 7, "outputs": -214463225281903248, "inputs": {"arr": [-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], "n": 32}}, {"idx": 8, "outputs": 0, "inputs": {"arr": [0, 0, 0, 0, 0, 0, 1, 1, 1, 1], "n": 6}}, {"idx": 9, "outputs": 8964536953959, "inputs": {"arr": [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], "n": 25}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(ArrayList<Integer> arr, Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(arr, n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(new ArrayList<>(Arrays.asList(3, 4, 5, 10, 14, 16, 18, 42, 43, 43, 45, 46, 51, 52, 53, 58, 61, 66, 79, 81, 82, 84)), 19, 4183488835L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-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, -107220607602444L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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, 1222222L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(45, 79)), 1, 45L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-90, -68, -38, -34, -4, 6, 10, 28, 48, 52, 54, 68, 88, 90)), 11, -10095534L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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, 122222L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(4, 8, 8, 23, 26, 27, 30, 42, 44, 55, 59, 64, 67, 69, 74, 77, 82, 82, 87, 96, 97)), 17, 615688689L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(-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, -214463225281903248L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(0, 0, 0, 0, 0, 0, 1, 1, 1, 1)), 6, 0L);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(new ArrayList<>(Arrays.asList(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, 8964536953959L);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(ArrayList<Integer> arr, Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(arr, n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__