Accepted
Code
#include<bits/stdc++.h>
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
bool isok(string s,string s1)
{
int i=0,j=0;
while (i<s.size()&& j<s1.size()) {
if (s[i]==s1[j]) {
j++;
}
i++;
}
return (j==s1.size());
}
int main()
{
faster
int t;
cin >> t;
while (t--) {
string s,s1;
cin >> s >> s1;
if (isok(s,s1)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1020 Favourite footballer
- Contest
- Brain booster - 1
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2023-12-31 14:47:07
- Judged At
- 2024-11-11 03:46:09
- Judged By
- Score
- 100
- Total Time
- 2ms
- Peak Memory
- 532.0 KiB