title: Check If String Remains Palindrome After Removing Given Number Of Characters
signature: function check_if_string_remains_palindrome_after_removing_given_number_of_characters(str, n)
source_py: def check_if_string_remains_palindrome_after_removing_given_number_of_characters(str, n):
      l = len(str)
      if (l >= n):
          return True
      return False
source_cpp: bool check_if_string_remains_palindrome_after_removing_given_number_of_characters(string str, int n) {
    int len = str . length ( );
    if ( len >= n ) return true;
    return false;
  }
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(str, n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(str, 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("ZCoQhuM", 2, true)
      print(string.format("TEST-0...%s",result))
  
      result = driver("7437725", 53, false)
      print(string.format("TEST-1...%s",result))
  
      result = driver("11", 30, false)
      print(string.format("TEST-2...%s",result))
  
      result = driver("buGlvR", 1, true)
      print(string.format("TEST-3...%s",result))
  
      result = driver("9", 92, false)
      print(string.format("TEST-4...%s",result))
  
      result = driver("101101010110", 3, true)
      print(string.format("TEST-5...%s",result))
  
      result = driver("YguiM", 18, false)
      print(string.format("TEST-6...%s",result))
  
      result = driver("8198", 90, false)
      print(string.format("TEST-7...%s",result))
  
      result = driver("11101", 71, false)
      print(string.format("TEST-8...%s",result))
  
      result = driver("hUInqJXNdbfP", 4, true)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"str": "ZCoQhuM", "n": 2}}, {"idx": 1, "outputs": false, "inputs": {"str": "7437725", "n": 53}}, {"idx": 2, "outputs": false, "inputs": {"str": "11", "n": 30}}, {"idx": 3, "outputs": true, "inputs": {"str": "buGlvR", "n": 1}}, {"idx": 4, "outputs": false, "inputs": {"str": "9", "n": 92}}, {"idx": 5, "outputs": true, "inputs": {"str": "101101010110", "n": 3}}, {"idx": 6, "outputs": false, "inputs": {"str": "YguiM", "n": 18}}, {"idx": 7, "outputs": false, "inputs": {"str": "8198", "n": 90}}, {"idx": 8, "outputs": false, "inputs": {"str": "11101", "n": 71}}, {"idx": 9, "outputs": true, "inputs": {"str": "hUInqJXNdbfP", "n": 4}}]
question_info.extension: lua
question_info.entry_fn_name: check_if_string_remains_palindrome_after_removing_given_number_of_characters
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: lua __FILENAME__