Verbose

0

0 votes
Easy
Problem

You have a string of lowercase English alphabetic letters. You can perform two types of operations on the string:

    1.Append a lowercase English alphabetic letter to the end of the string.
    2.Delete the last character in the string. Performing this operation on an empty string results in an empty string.

Given an integer,k , and two strings,s and t, determine whether or not you can convert s to t by performing exactly k of the above operations on .
If it's possible, print Yes. Otherwise, print No.

Input:
    t test cases
    The first line contains a string s, the initial string.
    The second line contains a string t, the desired final string.
    The third line contains an integer k, the number of operations.

EXAMPLE1:
    1  //test cases
    hackerhappy
    hackerrank
    9
    Output: Yes
    // delete happy from first string in 5 operations and add rahk at end using 4 operations.
    //total operations=9.

Time Limit: 1
Memory Limit: 256
Source Limit:
Contributers:
Editor Image

?