Skip to content

Commit d341eca

Browse files
authored
Create 392. Is Subsequence
1 parent 6d457c7 commit d341eca

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

392. Is Subsequence

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class Solution {
2+
public:
3+
bool isSubsequence(string s, string t)
4+
{
5+
string temp;
6+
int a=0;
7+
for(int i=0; i<t.length(); i++)
8+
{
9+
if(t[i]==s[a])
10+
{
11+
temp+=t[i];
12+
a++;
13+
}
14+
15+
}
16+
if(s==temp)
17+
return true;
18+
else
19+
return false;
20+
}
21+
};

0 commit comments

Comments
 (0)