55561bc4创建于 2022年12月27日历史提交
class Solution {
    public boolean isSubsequence(String s, String t) {
        int i = 0, j = 0;
        while (i < s.length() && j < t.length()) {
            if (s.charAt(i) == t.charAt(j)) {
                i += 1;
            }
            j += 1;
        }
        if (i == s.length()) {
            return true; 
        } else {
            return false;
        }
    }
}