Skip to content

Commit 9ba1e2c

Browse files
committed
Time: 0 ms (100.00%), Space: 6.4 MB (72.95%) - LeetHub
1 parent b067e46 commit 9ba1e2c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Solution {
2+
public:
3+
bool isSubsequence(string s, string t) {
4+
int i=0,j=0;
5+
6+
7+
while(i<s.size()&&j<t.size())
8+
{
9+
if(s[i]==t[j])
10+
{
11+
i++;
12+
}
13+
j++;
14+
}
15+
16+
17+
return i==s.size();
18+
}
19+
};

0 commit comments

Comments
 (0)