1
0
Fork 0
mirror of https://gitlab.com/mfocko/LeetCode.git synced 2024-09-19 17:56:55 +02:00
LeetCode/go/append-characters-to-string-to-make-subsequence.go
2024-06-03 15:29:18 +02:00

14 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
}