Long Pressed Name
easyCheck if typed string could be result of long pressing name
Long Pressed Name
Key Insight
Walk both strings: match advances both pointers. Long-press (repeat of previous) advances typed pointer only.
Step 1Setup
name="alex"
i
j
a
0a
1l
2e
3e
4x
5→→same direction
name="alex", typed="aaleex". i=0 on name, j=0 on typed.
1 / 5