leetcode_打卡11
题目:392. 判断子序列
代码:
class Solution {
public boolean isSubsequence(String s, String t) {
int n = s.length(), m = t.length();
int i = 0, j = 0;
while (i < n && j < m) {
if (s.charAt(i) == t.charAt(j)) {
i++;
}
j++;
}
return i == n;
}
}
标签:11,String,++,int,打卡,leetcode
From: https://www.cnblogs.com/ZLey/p/17344436.html