Grokking the Coding Interview: Patterns for Coding Questions
Ask Author
Back to course home

0% completed

Vote For New Content
Isn't it more accurate to call this a one-pointer approach?

izanmubarak

Aug 16, 2023

I'm not really seeing how this is a two pointer solution. It seems like you only loop through the array from start to finish to store the positions of the two words with a single pointer, and you update shortestDistance accordingly

2

0

Comments
Comments