We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 04f9b77 + fea6e0f commit 05c62daCopy full SHA for 05c62da
kotlin/0392-is-subsequence.kt
@@ -0,0 +1,11 @@
1
+class Solution {
2
+ fun isSubsequence(s: String, t: String): Boolean {
3
+ var sIndex = 0
4
+ var tIndex = 0
5
+ while(sIndex < s.length && tIndex < t.length){
6
+ if(s[sIndex] == t[tIndex]) sIndex++
7
+ tIndex++
8
+ }
9
+ return sIndex == s.length
10
11
+}
0 commit comments