@@ -0,0 +1,881 @@
+import java.util.List;%0Aimport java.util.ArrayList;%0Aimport java.util.Collections;%0A%0Aclass Solution %7B%0A    public boolean isSubsequence(String s, String t) %7B%0A        List%3CInteger%3E%5B%5D idx = new List%5B256%5D;%0A        for (int i = 0; i %3C t.length(); i++) %7B%0A            if (idx%5Bt.charAt(i)%5D == null) %7B%0A                idx%5Bt.charAt(i)%5D = new ArrayList%3C%3E();%0A            %7D%0A            idx%5Bt.charAt(i)%5D.add(i);%0A        %7D%0A%0A        int prev = 0;%0A        for (int i = 0; i %3C s.length(); i++) %7B%0A            if (idx%5Bs.charAt(i)%5D == null) %7B%0A                return false;%0A            %7D%0A            int j = Collections.binarySearch(idx%5Bs.charAt(i)%5D, prev);%0A            if (j %3C 0) %7B%0A                j = - (j + 1);%0A            %7D%0A            if (j == idx%5Bs.charAt(i)%5D.size()) %7B%0A                return false;%0A            %7D%0A            prev = idx%5Bs.charAt(i)%5D.get(j) + 1;%0A        %7D%0A        return true;%0A    %7D%0A%7D

392. Is Subsequence