title: Converting One String Using Append Delete Last Operations
signature: function converting_one_string_using_append_delete_last_operations(str1, str2, k)
source_py: def converting_one_string_using_append_delete_last_operations(str1, str2, k):
      if ((len(str1) + len(str2)) < k):
          return True
      commonLength = 0
      for i in range(0, min(len(str1), len(str2)), 1):
          if (str1[i] == str2[i]):
              commonLength += 1
          else:
              break
      if (((((k - len(str1)) - len(str2)) + (2 * commonLength)) % 2) == 0):
          return True
      return False
source_cpp: bool converting_one_string_using_append_delete_last_operations(string str1, string str2, int k) {
    if ( ( str1 . length ( ) + str2 . length ( ) ) < k ) return true;
    int commonLength = 0;
    for ( int i = 0;
    i < min ( str1 . length ( ), str2 . length ( ) );
    i ++ ) {
      if ( str1 [ i ] == str2 [ i ] ) commonLength ++;
      else break;
    }
    if ( ( k - str1 . length ( ) - str2 . length ( ) + 2 * commonLength ) % 2 == 0 ) return true;
    return false;
  }
question_info.entry_fn_name: converting_one_string_using_append_delete_last_operations
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(str1, str2, k, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(str1, str2, k) 
      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("ZNHGro", "jAdbtDUYQu", 3, false)
      print(string.format("TEST-0...%s",result))
  
      result = driver("382880806774", "65565", 10, false)
      print(string.format("TEST-1...%s",result))
  
      result = driver("0", "00100010100", 2, true)
      print(string.format("TEST-2...%s",result))
  
      result = driver("lxHTRFCTSQ", "sViXYE", 89, true)
      print(string.format("TEST-3...%s",result))
  
      result = driver("6399914758", "780990121", 9, true)
      print(string.format("TEST-4...%s",result))
  
      result = driver("01100011100000", "0100", 0, true)
      print(string.format("TEST-5...%s",result))
  
      result = driver("WkGqlob", "NpQVdXzEtUZy", 6, false)
      print(string.format("TEST-6...%s",result))
  
      result = driver("46974006151", "74438", 11, false)
      print(string.format("TEST-7...%s",result))
  
      result = driver("1001001", "1000010", 15, true)
      print(string.format("TEST-8...%s",result))
  
      result = driver("IJQ", "nFOHAeYEAp", 42, true)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": false, "inputs": {"str1": "ZNHGro", "str2": "jAdbtDUYQu", "k": 3}}, {"idx": 1, "outputs": false, "inputs": {"str1": "382880806774", "str2": "65565", "k": 10}}, {"idx": 2, "outputs": true, "inputs": {"str1": "0", "str2": "00100010100", "k": 2}}, {"idx": 3, "outputs": true, "inputs": {"str1": "lxHTRFCTSQ", "str2": "sViXYE", "k": 89}}, {"idx": 4, "outputs": true, "inputs": {"str1": "6399914758", "str2": "780990121", "k": 9}}, {"idx": 5, "outputs": true, "inputs": {"str1": "01100011100000", "str2": "0100", "k": 0}}, {"idx": 6, "outputs": false, "inputs": {"str1": "WkGqlob", "str2": "NpQVdXzEtUZy", "k": 6}}, {"idx": 7, "outputs": false, "inputs": {"str1": "46974006151", "str2": "74438", "k": 11}}, {"idx": 8, "outputs": true, "inputs": {"str1": "1001001", "str2": "1000010", "k": 15}}, {"idx": 9, "outputs": true, "inputs": {"str1": "IJQ", "str2": "nFOHAeYEAp", "k": 42}}]