You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
473 B

#include <bits/stdc++.h>
using namespace std;
char a[100005], b[100005];
int main() {
while (~scanf("%s%s", a, b)) {
int start = 0, lenb = strlen(b), lena = strlen(a);
for (int i = 0; i < lenb; i++) {
if (a[start] == b[i])
start++;
if (start == lena) {
printf("Yes\n");
break;
}
}
if (start != lena)
printf("No\n");
}
return 0;
}