Recap: Check Why Each Pointer Moved

In every exercise here, the data’s order told you which index could safely move. This is what each problem asked of you:

Exercise The question that unlocked it
Palindrome Check That Survives Emoji Do the characters at both ends match, counting an emoji as one character?
Merge Two Sorted Activity Feeds Which feed’s next event comes first?
Review an AI-Written In-Place Dedupe What happens to the loop index after splice() removes an item?
Two Sum on a Sorted Price List Is the current sum too small or too big, and which pointer does that let you move?

A quick self-check: think of the test that stayed red the longest for you. Which assumption in your code did it break? Interviewers often ask exactly that kind of question, and it’s a lot easier to answer once you’ve talked it through.

Want a second pair of eyes on your Two Pointers work?

Sliding windows come next. They keep both indexes moving forward too, but what matters is everything in between them.

Become a Member to join the conversation.