title: Converting One String Using Append Delete Last Operations
signature: function convertingOneStringUsingAppendDeleteLastOperations($str1, $str2, $k) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($str1, $str2, $k, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($str1, $str2, $k), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        "ZNHGro", "jAdbtDUYQu", 3, 
        false));
      
      printf("TEST-1...%s\n",driver(
        "382880806774", "65565", 10, 
        false));
      
      printf("TEST-2...%s\n",driver(
        "0", "00100010100", 2, 
        true));
      
      printf("TEST-3...%s\n",driver(
        "lxHTRFCTSQ", "sViXYE", 89, 
        true));
      
      printf("TEST-4...%s\n",driver(
        "6399914758", "780990121", 9, 
        true));
      
      printf("TEST-5...%s\n",driver(
        "01100011100000", "0100", 0, 
        true));
      
      printf("TEST-6...%s\n",driver(
        "WkGqlob", "NpQVdXzEtUZy", 6, 
        false));
      
      printf("TEST-7...%s\n",driver(
        "46974006151", "74438", 11, 
        false));
      
      printf("TEST-8...%s\n",driver(
        "1001001", "1000010", 15, 
        true));
      
      printf("TEST-9...%s\n",driver(
        "IJQ", "nFOHAeYEAp", 42, 
        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;
  }