Day 2 / 745 min
Remember what you have seen
Use a set or map to answer a lookup without scanning the earlier values again.
Learn the concept
Answer "have I seen this before?" in expected constant time with a hash table, and compare substrings with polynomial hashes.
Open the lesson Watch Two SumPractice
Recall without notes
Trace Two Sum on [3, 3] with target 6. Explain why the lookup must happen before the insertion.