title: Minimize The Sum Of Digits Of A And B Such That A B N
signature: minimizeTheSumOfDigitsOfAAndBSuchThatABN(n) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(n, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          2, 
          2)
      }");
  
      print("TEST-1...${driver(
          39, 
          12)
      }");
  
      print("TEST-2...${driver(
          31, 
          4)
      }");
  
      print("TEST-3...${driver(
          45, 
          9)
      }");
  
      print("TEST-4...${driver(
          35, 
          8)
      }");
  
      print("TEST-5...${driver(
          94, 
          13)
      }");
  
      print("TEST-6...${driver(
          67, 
          13)
      }");
  
      print("TEST-7...${driver(
          50, 
          5)
      }");
  
      print("TEST-8...${driver(
          4, 
          4)
      }");
  
      print("TEST-9...${driver(
          63, 
          9)
      }");
  
      return 0;
  }
source_py: def minimize_the_sum_of_digits_of_a_and_b_such_that_a_b_n(n):
      sum = 0
      while (n > 0):
          sum += (n % 10)
          n //= 10
      if (sum == 1):
          return 10
      return sum
source_cpp: int minimize_the_sum_of_digits_of_a_and_b_such_that_a_b_n(int n) {
    int sum = 0;
    while ( n > 0 ) {
      sum += ( n % 10 );
      n /= 10;
    }
    if ( sum == 1 ) return 10;
    return sum;
  }