title: Nth Even Length Palindrome
signature: function nth_even_length_palindrome(n)
source_py: def nth_even_length_palindrome(n):
      res = n
      for j in range((len(n) - 1), (- 1), (- 1)):
          res += n[j]
      return res
source_cpp: string nth_even_length_palindrome(string n) {
    string res = n;
    for ( int j = n . length ( ) - 1;
    j >= 0;
    -- j ) res += n [ j ];
    return res;
  }
question_info.entry_fn_name: nth_even_length_palindrome
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7']
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, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      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("lSUhEvxcgfI", "lSUhEvxcgfIIfgcxvEhUSl")
      print(string.format("TEST-0...%s",result))
  
      result = driver("77329283", "7732928338292377")
      print(string.format("TEST-1...%s",result))
  
      result = driver("010111111", "010111111111111010")
      print(string.format("TEST-2...%s",result))
  
      result = driver("Stazb", "StazbbzatS")
      print(string.format("TEST-3...%s",result))
  
      result = driver("0702", "07022070")
      print(string.format("TEST-4...%s",result))
  
      result = driver("01111111", "0111111111111110")
      print(string.format("TEST-5...%s",result))
  
      result = driver("a", "aa")
      print(string.format("TEST-6...%s",result))
  
      result = driver("rznb", "rznbbnzr")
      print(string.format("TEST-7...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": "lSUhEvxcgfIIfgcxvEhUSl", "inputs": {"n": "lSUhEvxcgfI"}}, {"idx": 1, "outputs": "7732928338292377", "inputs": {"n": "77329283"}}, {"idx": 2, "outputs": "010111111111111010", "inputs": {"n": "010111111"}}, {"idx": 3, "outputs": "StazbbzatS", "inputs": {"n": "Stazb"}}, {"idx": 4, "outputs": "07022070", "inputs": {"n": "0702"}}, {"idx": 5, "outputs": "0111111111111110", "inputs": {"n": "01111111"}}, {"idx": 6, "outputs": "aa", "inputs": {"n": "a"}}, {"idx": 7, "outputs": "rznbbnzr", "inputs": {"n": "rznb"}}]