Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Valid Word Abbreviation
Bookmark
Brute Force
Two Pointers
Input
Valid (i12iz4n)
Invalid (a2e)
Valid (s10n)
Custom
word
=
internationalization
,
abbr
=
i12iz4n
abbr
i
1
2
i
z
4
n
expanded
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
abbr
i
1
2
i
z
4
n
expanded
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
abbr
i
1
2
i
z
4
n
expanded
i
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
num =
1
* 10 +
2
=
12
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
'z'
is a letter, copied as-is
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
expanded length 20
==
word length 20
→ compare each position
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
k
expanded[2] = '*'
→ matches any letter
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
k
expanded[6] = '*'
→ matches any letter
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
k
expanded[9] = '*'
→ matches any letter
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
k
'i'
==
'i'
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
k
expanded[16] = '*'
→ matches any letter
abbr
i
1
2
i
z
4
n
expanded
i
*
*
*
*
*
*
*
*
*
*
*
*
i
z
*
*
*
*
n
word
i
n
t
e
r
n
a
t
i
o
n
a
l
i
z
a
t
i
o
n
"i12iz4n" is a valid abbreviation
return true
algo
master
.
io
Step:
Is "i12iz4n" a valid abbreviation of "internationalization"?
0 / 32
Input
Valid (i12iz4n)
Invalid (a2e)
Valid (s10n)
Custom
word
=
internationalization
,
abbr
=
i12iz4n
0 / 32
algo
master
.
io
Step:
Is "i12iz4n" a valid abbreviation of "internationalization"?