判断子序列 Is Subsequence 解 双指针直接遍历 bool isSubsequence(char * s, char * t) { while (*s && *t){ if (*s == *t){ s++; } t++; } if (*s == '\0'){ return true; } return false; } 结果 进阶 思路:用二维数组将t中每个字母出现的位置保存下来,然后只需要查找s在t中对应字母顺序是否为升序就可。