count
to 1 and a StringBuilder
with string a
.b
is already a substring of a
. If yes, return count
.StringBuilder
is less than the length of b
, append a
to it and increment count
.b
is a substring of the StringBuilder
. If yes, return count
.StringBuilder
exceeds the length of b
plus the length of a
and b
is still not a substring, return -1.