Skip to content

Commit 89343e5

Browse files
committed
Create: 0392-Is-Subseqyence.dart
1 parent ff32745 commit 89343e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: dart/0392-is-subsequence.dart

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
bool isSubsequence(String s, String t) {
3+
int i = 0, j = 0;
4+
while (i < t.length && j != s.length) {
5+
if (t[i] == s[j]) {
6+
j += 1;
7+
}
8+
i += 1;
9+
}
10+
return j == s.length;
11+
}
12+
}

0 commit comments

Comments
 (0)