package leetcode;

/**
 * https://leetcode.com/problems/is-subsequence/
 */
public class Problem392 {
    public boolean isSubsequence(String s, String t) {
        // TODO
        return false;
    }

    public static void main(String[] args) {
        Problem392 prob = new Problem392();
        System.out.println(prob.isSubsequence("ace", "abcde")); // true
        System.out.println(prob.isSubsequence("aec", "abcde")); // false
        System.out.println(prob.isSubsequence("abc", "ahbgdc")); // true
        System.out.println(prob.isSubsequence("axc", "ahbgdc")); // false
    }
}

@@ -162,36 +162,415 @@
     
-// TODO%0A        return false
+int idx = 0;%0A        int count = 0;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            char c1 = s.charAt(i);%0A            for (int j = idx; j %3C t.length(); j++) %7B%0A                char c2 = t.charAt(j);%0A                if (c1 == c2) %7B%0A                    idx = j + 1;%0A                    count++;%0A                    break;%0A                %7D%0A            %7D%0A        %7D%0A        return count == s.length()
 ;%0A  

Solve problem 392