public boolean isSubsequence(String s, String t) {
        if (s == null || t == null) return false;
        if (s.isEmpty()) return true;

        int ps = 0, pt = 0;
        while (pt < t.length()) {
            if (s.charAt(ps) == t.charAt(pt)) {
                ++ps;
                if (ps == s.length()) return true;
            }
            ++pt;
        }
        return false;
    }