i
for word
and j
for abbr
, starting at 0.i < len(word)
and j < len(abbr)
.abbr[j]
is a letter:
a. Check if word[i]
matches abbr[j]
. If not, return False
.
b. Increment both i
and j
.abbr[j]
is a digit:
a. Check for leading zeros. If found, return False
.
b. Parse the complete number represented by consecutive digits.
c. Increment i
by the parsed number.
d. Increment j
to move past the digits.i
and j
have reached the end of their respective strings. If so, return True
. Otherwise, return False
.