https://leetcode.com/problems/is-subsequence/
index记录t中已经遍历的位置。
class Solution {
public boolean isSubsequence(String s, String t) {
int index = -1;
for(char c:s.toCharArray()){
index = t.indexOf(c, index+1);
if(index == -1) return false;
}
return true;
}
}