left
for the s
string and right
for the t
string, starting at 0.s[left]
and t[right]
match, increment left
.
b. Increment right
.left
equals the length of s
, return true
as all characters in s
have been matched in t
.t
is reached (i.e., right
equals the length of t
), return false
as not all characters in s
could be matched.