Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline bool issubstr(string t, string ss)
- {
- if (t == ss)
- return true;
- int lt, lss;
- lt = t.size();
- lss = ss.size();
- if (lss > lt)
- return false;
- int j = 0;
- for (int i = 0; i < lt && j < lss && lss - j <= lt - i; i++)
- {
- if (ss[j] == t[i])
- j++;
- }
- if (j == lss)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement