title: Basic And Extended Euclidean Algorithms
signature: fun basicAndExtendedEuclideanAlgorithms(a: Int, b: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(a: Int, b: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(46, 89, 1)
      println("TEST-0...${result}")
      
      result = driver(26, 82, 2)
      println("TEST-1...${result}")
      
      result = driver(40, 12, 4)
      println("TEST-2...${result}")
      
      result = driver(58, 4, 2)
      println("TEST-3...${result}")
      
      result = driver(25, 44, 1)
      println("TEST-4...${result}")
      
      result = driver(2, 87, 1)
      println("TEST-5...${result}")
      
      result = driver(8, 65, 1)
      println("TEST-6...${result}")
      
      result = driver(21, 87, 3)
      println("TEST-7...${result}")
      
      result = driver(82, 10, 2)
      println("TEST-8...${result}")
      
      result = driver(17, 61, 1)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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 );
  }