title: Gcd Elements Given Range
signature: function gcdElementsGivenRange(n: number, m: number): number {
source_py: def gcd_elements_given_range(n, m):
      return (n if (n == m) else 1)
source_cpp: int gcd_elements_given_range(int n, int m) {
    return ( n == m ) ? n : 1;
  }
question_info.test_list: [{"idx": 0, "outputs": 57, "inputs": {"n": 57, "m": 57}}, {"idx": 1, "outputs": 22, "inputs": {"n": 22, "m": 22}}, {"idx": 2, "outputs": 17, "inputs": {"n": 17, "m": 17}}, {"idx": 3, "outputs": 74, "inputs": {"n": 74, "m": 74}}, {"idx": 4, "outputs": 1, "inputs": {"n": 93, "m": 22}}, {"idx": 5, "outputs": 1, "inputs": {"n": 56, "m": 54}}, {"idx": 6, "outputs": 1, "inputs": {"n": 5, "m": 33}}, {"idx": 7, "outputs": 1, "inputs": {"n": 5, "m": 68}}, {"idx": 8, "outputs": 1, "inputs": {"n": 9, "m": 75}}, {"idx": 9, "outputs": 1, "inputs": {"n": 98, "m": 21}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, m: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n, m),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(57, 57, 57);
    console.log(`TEST-0...${result}`);
  
    result = driver(22, 22, 22);
    console.log(`TEST-1...${result}`);
  
    result = driver(17, 17, 17);
    console.log(`TEST-2...${result}`);
  
    result = driver(74, 74, 74);
    console.log(`TEST-3...${result}`);
  
    result = driver(93, 22, 1);
    console.log(`TEST-4...${result}`);
  
    result = driver(56, 54, 1);
    console.log(`TEST-5...${result}`);
  
    result = driver(5, 33, 1);
    console.log(`TEST-6...${result}`);
  
    result = driver(5, 68, 1);
    console.log(`TEST-7...${result}`);
  
    result = driver(9, 75, 1);
    console.log(`TEST-8...${result}`);
  
    result = driver(98, 21, 1);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: gcdElementsGivenRange
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js