Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- string s,r;
- cin>> s >> r;
- int len = r.size();
- int a=0,ct=0;
- for(int i=0; i<r.size(); i++)
- {
- for(int j=a; j<s.size(); j++)
- {
- if(r[i]==s[j])
- {
- ct++;
- a=j+1;
- break;
- }
- }
- }
- if(len == ct)
- cout<<"YES"<<endl;
- else
- cout<<"NO"<<endl;
- //if()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement