title: Minimize The Sum Of Digits Of A And B Such That A B N
signature: pub fn minimize_the_sum_of_digits_of_a_and_b_such_that_a_b_n(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        2, 
        2
      ));
      
      println!("TEST-1...{}", driver(
        39, 
        12
      ));
      
      println!("TEST-2...{}", driver(
        31, 
        4
      ));
      
      println!("TEST-3...{}", driver(
        45, 
        9
      ));
      
      println!("TEST-4...{}", driver(
        35, 
        8
      ));
      
      println!("TEST-5...{}", driver(
        94, 
        13
      ));
      
      println!("TEST-6...{}", driver(
        67, 
        13
      ));
      
      println!("TEST-7...{}", driver(
        50, 
        5
      ));
      
      println!("TEST-8...{}", driver(
        4, 
        4
      ));
      
      println!("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;
  }