title: Converting One String Using Append Delete Last Operations
signature: converting_one_string_using_append_delete_last_operations <- function(str1, str2, k) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(str1, str2, k, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(str1, str2, k), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          "ZNHGro", "jAdbtDUYQu", 3L, 
          FALSE
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          "382880806774", "65565", 10L, 
          FALSE
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          "0", "00100010100", 2L, 
          TRUE
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          "lxHTRFCTSQ", "sViXYE", 89L, 
          TRUE
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          "6399914758", "780990121", 9L, 
          TRUE
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          "01100011100000", "0100", 0L, 
          TRUE
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          "WkGqlob", "NpQVdXzEtUZy", 6L, 
          FALSE
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          "46974006151", "74438", 11L, 
          FALSE
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          "1001001", "1000010", 15L, 
          TRUE
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          "IJQ", "nFOHAeYEAp", 42L, 
          TRUE
      )))
  
  }
  
  main()
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;
  }