Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ll j = 0
- ll idx = n
- for(int i = n-1;i>-1;i--)
- { if(s[i] == t[t.size()-1-j]){
- j += 1;
- idx = i
- if(j == n)
- break;
- }}
- if j < n
- {
- j += 1;
- for(int i = idx-1;i > -1;i--)
- {
- if(s[i] == t[t.size()-1-j]){
- j += 1;
- idx = i
- if(j == n)
- break;
- }}
- }
- if(j == n)
- cout « "yes";
- else
- cout « "no";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement