title: Basic And Extended Euclidean Algorithms
signature: pub fn basic_and_extended_euclidean_algorithms(a: i32, b: 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(a: i32, b: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(a, b), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        46, 89, 
        1
      ));
      
      println!("TEST-1...{}", driver(
        26, 82, 
        2
      ));
      
      println!("TEST-2...{}", driver(
        40, 12, 
        4
      ));
      
      println!("TEST-3...{}", driver(
        58, 4, 
        2
      ));
      
      println!("TEST-4...{}", driver(
        25, 44, 
        1
      ));
      
      println!("TEST-5...{}", driver(
        2, 87, 
        1
      ));
      
      println!("TEST-6...{}", driver(
        8, 65, 
        1
      ));
      
      println!("TEST-7...{}", driver(
        21, 87, 
        3
      ));
      
      println!("TEST-8...{}", driver(
        82, 10, 
        2
      ));
      
      println!("TEST-9...{}", driver(
        17, 61, 
        1
      ));
      
  }
source_py: def basic_and_extended_euclidean_algorithms(a, b):
      if (a == 0):
          return b
      return basic_and_extended_euclidean_algorithms((b % a), a)
source_cpp: int basic_and_extended_euclidean_algorithms(int a, int b) {
    if ( a == 0 ) return b;
    return basic_and_extended_euclidean_algorithms ( b % a, a );
  }