Mock CCC '19 Contest 1 S2 - Strings

View as PDF

Submit solution

Points: 7 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

You are given two strings A and B. You want to check whether it is possible to create string A from string B by inserting characters into string B without changing the order of the existing characters.

Input Specification

The first line will contain the string A\ (1 \le |A| \le 10^5).

The second line will contain the string B\ (1 \le |B| \le |A|).

It is guaranteed A and B will only contain lowercase latin characters.

Output Specification

Output YES if it is possible, and NO otherwise.

Subtasks

For 5/15 points, |A| \le 100.

Sample Input

abcadbefgh
abcdef

Sample Output

YES

Comments

There are no comments at the moment.