Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ll j = 0
  2. ll idx = n
  3. for(int i = n-1;i>-1;i--)
  4. { if(s[i] == t[t.size()-1-j]){
  5. j += 1;
  6. idx = i
  7. if(j == n)
  8. break;
  9. }}
  10. if j < n
  11. {
  12. j += 1;
  13. for(int i = idx-1;i > -1;i--)
  14. {
  15. if(s[i] == t[t.size()-1-j]){
  16. j += 1;
  17. idx = i
  18. if(j == n)
  19. break;
  20. }}
  21. }
  22. if(j == n)
  23. cout « "yes";
  24. else
  25. cout « "no";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement