title: Basic And Extended Euclidean Algorithms
signature: basicAndExtendedEuclideanAlgorithms(a, b) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(a, b, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(a, b), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          46, 89, 
          1)
      }");
  
      print("TEST-1...${driver(
          26, 82, 
          2)
      }");
  
      print("TEST-2...${driver(
          40, 12, 
          4)
      }");
  
      print("TEST-3...${driver(
          58, 4, 
          2)
      }");
  
      print("TEST-4...${driver(
          25, 44, 
          1)
      }");
  
      print("TEST-5...${driver(
          2, 87, 
          1)
      }");
  
      print("TEST-6...${driver(
          8, 65, 
          1)
      }");
  
      print("TEST-7...${driver(
          21, 87, 
          3)
      }");
  
      print("TEST-8...${driver(
          82, 10, 
          2)
      }");
  
      print("TEST-9...${driver(
          17, 61, 
          1)
      }");
  
      return 0;
  }
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 );
  }