title: Minimize The Sum Of Digits Of A And B Such That A B N
signature: def minimizeTheSumOfDigitsOfAAndBSuchThatABN(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        2, 
        2    
      )}")   
  
  
      println(s"TEST-1...${driver(
        39, 
        12    
      )}")   
  
  
      println(s"TEST-2...${driver(
        31, 
        4    
      )}")   
  
  
      println(s"TEST-3...${driver(
        45, 
        9    
      )}")   
  
  
      println(s"TEST-4...${driver(
        35, 
        8    
      )}")   
  
  
      println(s"TEST-5...${driver(
        94, 
        13    
      )}")   
  
  
      println(s"TEST-6...${driver(
        67, 
        13    
      )}")   
  
  
      println(s"TEST-7...${driver(
        50, 
        5    
      )}")   
  
  
      println(s"TEST-8...${driver(
        4, 
        4    
      )}")   
  
  
      println(s"TEST-9...${driver(
        63, 
        9    
      )}")   
  
  }
  
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;
  }