title: Sum Two Large Numbers
signature: pub fn sum_two_large_numbers(str1: String, str2: String) -> String {
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: String, expected: String)->bool{
  return actual==expected
  }
  pub fn driver(str1: String, str2: String, expected: String)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(str1, str2), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "VkfzrPG".to_string(), "rKZ".to_string(), 
        "44527855".to_string()
      ));
      
      println!("TEST-1...{}", driver(
        "0526110506447".to_string(), "903".to_string(), 
        "0526110507350".to_string()
      ));
      
      println!("TEST-2...{}", driver(
        "011010010".to_string(), "110100000".to_string(), 
        "121110010".to_string()
      ));
      
      println!("TEST-3...{}", driver(
        "sPAwZACc ".to_string(), "liYMsojPiinOV".to_string(), 
        "66153436372942".to_string()
      ));
      
      println!("TEST-4...{}", driver(
        "3".to_string(), "611".to_string(), 
        "614".to_string()
      ));
      
      println!("TEST-5...{}", driver(
        "0101".to_string(), "01110101011".to_string(), 
        "01110101112".to_string()
      ));
      
      println!("TEST-6...{}", driver(
        "VTtNu".to_string(), "Wsmc".to_string(), 
        "469530".to_string()
      ));
      
      println!("TEST-7...{}", driver(
        "2317170".to_string(), "898421173423".to_string(), 
        "898423490593".to_string()
      ));
      
      println!("TEST-8...{}", driver(
        "111111000010".to_string(), "01100001110111".to_string(), 
        "01211112110121".to_string()
      ));
      
      println!("TEST-9...{}", driver(
        "Ktt".to_string(), "CTbbVX wGBkE".to_string(), 
        "2315420138859".to_string()
      ));
      
  }
source_py: def sum_two_large_numbers(str1, str2):
      if (len(str1) > len(str2)):
          t = str1
          str1 = str2
          str2 = t
      str = ''
      n1 = len(str1)
      n2 = len(str2)
      str1 = str1[::(- 1)]
      str2 = str2[::(- 1)]
      carry = 0
      for i in range(n1):
          sum = ((ord(str1[i]) - 48) + ((ord(str2[i]) - 48) + carry))
          str += chr(((sum % 10) + 48))
          carry = int((sum / 10))
      for i in range(n1, n2):
          sum = ((ord(str2[i]) - 48) + carry)
          str += chr(((sum % 10) + 48))
          carry = int((sum / 10))
      if carry:
          str += chr((carry + 48))
      str = str[::(- 1)]
      return str
source_cpp: string sum_two_large_numbers(string str1, string str2) {
    if ( str1 . length ( ) > str2 . length ( ) ) swap ( str1, str2 );
    string str = "";
    int n1 = str1 . length ( ), n2 = str2 . length ( );
    reverse ( str1 . begin ( ), str1 . end ( ) );
    reverse ( str2 . begin ( ), str2 . end ( ) );
    int carry = 0;
    for ( int i = 0;
    i < n1;
    i ++ ) {
      int sum = ( ( str1 [ i ] - '0' ) + ( str2 [ i ] - '0' ) + carry );
      str . push_back ( sum % 10 + '0' );
      carry = sum / 10;
    }
    for ( int i = n1;
    i < n2;
    i ++ ) {
      int sum = ( ( str2 [ i ] - '0' ) + carry );
      str . push_back ( sum % 10 + '0' );
      carry = sum / 10;
    }
    if ( carry ) str . push_back ( carry + '0' );
    reverse ( str . begin ( ), str . end ( ) );
    return str;
  }