Last active
February 16, 2020 15:52
-
-
Save 0bach0/88e06f5439dd485f9937f78c32d85b31 to your computer and use it in GitHub Desktop.
Revisions
-
0bach0 revised this gist
Feb 16, 2020 . No changes.There are no files selected for viewing
-
0bach0 created this gist
Feb 16, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ package jp.vietpro.vta; public class SubSequence { public static boolean isSubsequence(String s, String t) { if(s.length()==0) return true; int sI=0; for (int tI=0; tI < t.length(); tI++ ){ if (t.charAt(tI) == s.charAt(sI)){ sI++; } if(sI >= s.length()){ return true; } } return false; } }