title: Converting One String Using Append Delete Last Operations
signature: function convertingOneStringUsingAppendDeleteLastOperations(str1: string, str2: string, k: number): boolean {
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.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}}]
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: boolean, expected: boolean): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(str1: string, str2: string, k: number, expected:boolean): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(str1, str2, k),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver("ZNHGro", "jAdbtDUYQu", 3, false);
    console.log(`TEST-0...${result}`);
  
    result = driver("382880806774", "65565", 10, false);
    console.log(`TEST-1...${result}`);
  
    result = driver("0", "00100010100", 2, true);
    console.log(`TEST-2...${result}`);
  
    result = driver("lxHTRFCTSQ", "sViXYE", 89, true);
    console.log(`TEST-3...${result}`);
  
    result = driver("6399914758", "780990121", 9, true);
    console.log(`TEST-4...${result}`);
  
    result = driver("01100011100000", "0100", 0, true);
    console.log(`TEST-5...${result}`);
  
    result = driver("WkGqlob", "NpQVdXzEtUZy", 6, false);
    console.log(`TEST-6...${result}`);
  
    result = driver("46974006151", "74438", 11, false);
    console.log(`TEST-7...${result}`);
  
    result = driver("1001001", "1000010", 15, true);
    console.log(`TEST-8...${result}`);
  
    result = driver("IJQ", "nFOHAeYEAp", 42, true);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: convertingOneStringUsingAppendDeleteLastOperations
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