title: Gcd Elements Given Range
signature: function gcd_elements_given_range(n, m)
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.entry_fn_name: gcd_elements_given_range
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(n, m, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n, m) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(57, 57, 57)
      print(string.format("TEST-0...%s",result))
  
      result = driver(22, 22, 22)
      print(string.format("TEST-1...%s",result))
  
      result = driver(17, 17, 17)
      print(string.format("TEST-2...%s",result))
  
      result = driver(74, 74, 74)
      print(string.format("TEST-3...%s",result))
  
      result = driver(93, 22, 1)
      print(string.format("TEST-4...%s",result))
  
      result = driver(56, 54, 1)
      print(string.format("TEST-5...%s",result))
  
      result = driver(5, 33, 1)
      print(string.format("TEST-6...%s",result))
  
      result = driver(5, 68, 1)
      print(string.format("TEST-7...%s",result))
  
      result = driver(9, 75, 1)
      print(string.format("TEST-8...%s",result))
  
      result = driver(98, 21, 1)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
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}}]