We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ff32745 commit 89343e5Copy full SHA for 89343e5
1 file changed
dart/0392-is-subsequence.dart
@@ -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