We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a13455c commit 2dae791Copy full SHA for 2dae791
392.cpp
@@ -0,0 +1,32 @@
1
+class Solution {
2
+public:
3
+ bool isSubsequence(string s, string t) {
4
+
5
+ int n=s.length();
6
+ int m =t.length();
7
+ int i,j;
8
+ for(i=0,j=0;i<n && j<m;)
9
+ {
10
+ if(s[i]!=t[j])
11
12
+ // i++;
13
+ j++;
14
+ }
15
+ else if(s[i]==t[j])
16
17
18
+ i++;
19
20
21
22
23
+ if(i==n)
24
25
+ return 1;
26
27
28
29
+ return 0;
30
31
32
+};
0 commit comments