Arrays and Hashing
15 / 170Arrays and HashingLesson 10 of 10About 39 min
Two problems from this unit, cold, plus the discriminations that decide whether the pattern actually transfers.
You solved these problems days or hours ago with the pattern freshly explained above them. That is the easy condition. The interview condition is meeting a problem with no label attached and having to work out which idea applies.
So this lesson does two things. It asks you to rebuild two problems from scratch without looking at your earlier submissions, and it drills the specific confusions that show up when these patterns arrive with no label on them.
You need to return every pair of indices (i, j) with i less than j whose values are equal. Which structure fits best?
Select every problem below that a precomputed prefix array makes meaningfully faster.
You have solved this one before. Rebuild it from scratch without looking at your old submission. If the approach does not come back within a few minutes, that is the signal that it needs another pass.
You have solved this one before. Rebuild it from scratch without looking at your old submission. If the approach does not come back within a few minutes, that is the signal that it needs another pass.