Skip to content

Commit d41772a

Browse files
Create 2486-append-characters-to-string-to-make-subsequence.java
1 parent 636aab3 commit d41772a

File tree

1 file changed

+12
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)