解题思路:
(1)设置两个指针,分别指向两个字符串
class Solution {
public:
bool isSubsequence(string s, string t) {
int i=0,j=0;
while(i<s.length() && j<t.length()) {
if(s[i]==t[j]) {
i++;j++;
}
else j++;
}
if(i==s.length()) return true;
else return false;
}
};