class Solution { public boolean isSubsequence(String s, String t) { if(s.length() == 0) { return true; } for (int i = 0, j = 0; j < t.length(); j++) { if(s.charAt(i) == t.charAt(j)) { i++; if(i == s.length()) { return true; } } } return false; } }
11-05
83
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-27
705
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-22
309
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-13
522
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)