题目: LeetCode: 392. Is Subsequence(https://leetcode.com/problems/is-subsequence/description/)
class Solution {
public boolean isSubsequence(String s, String t) {
int currentLoc = 0;
byte[] bytes = s.getBytes();
for (int i = 0; i < bytes.length; i++) {
currentLoc = t.indexOf(bytes[i], currentLoc);
if (currentLoc == -1) {
return false;
}
currentLoc++;
}
return true;
}
}