class Solution {
public:
bool isSubsequence(string s, string t) {
if (s.size() <= 0) return true;
int ps=0, pt=0;
while (pt < t.size()) {
if (s[ps] == t[pt]) {
ps++; pt++;
if (ps >= s.size()) return true;
}else {
pt++;
}
}
return false;
}
};
#include <iostream>
using namespace std;
class Solution {
public:
bool isSubsequence(string s, string t) {
int index = -1;
for(char c: s){
index = t.find(c, index + 1);
if(index == string::npos) return false;
}
return true;
}
};
int main() {
return 0;
}