mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-09-20 01:56:57 +02:00
15 lines
223 B
Go
15 lines
223 B
Go
|
package append_characters_to_string_to_make_subsequence
|
||
|
|
||
|
func appendCharacters(s string, t string) int {
|
||
|
si, ti := 0, 0
|
||
|
|
||
|
for si < len(s) && ti < len(t) {
|
||
|
if s[si] == t[ti] {
|
||
|
ti++
|
||
|
}
|
||
|
si++
|
||
|
}
|
||
|
|
||
|
return len(t) - ti
|
||
|
}
|