Leetcode in Java && Oracle
422 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2022-06-24_15-16-19.png
34 KB
#N392. Is Subsequence
problem link
#solution
class Solution {
public boolean isSubsequence(String s, String t) {
if(s.length()==0) return true;
int is=0, it=0;
while(it<t.length()){
if(s.charAt(is)==t.charAt(it)){
is++;
if(is==s.length()) return true;
}
it++;
}
return false;
}
}
👍2