library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub maspypy/library

:heavy_check_mark: string/is_subseq.hpp

Verified with

Code

template <typename STRING>
bool is_subseq(STRING& S, STRING& T) {
  ll p = 0;
  for (auto&& s: S) {
    while (p < len(T) && T[p] != s) ++p;
    if (p == len(T)) return false;
    ++p;
  }
  return true;
}
#line 1 "string/is_subseq.hpp"
template <typename STRING>
bool is_subseq(STRING& S, STRING& T) {
  ll p = 0;
  for (auto&& s: S) {
    while (p < len(T) && T[p] != s) ++p;
    if (p == len(T)) return false;
    ++p;
  }
  return true;
}
Back to top page