Set 04 - Hash Maps Deep Dive

Use Practice Loop if you need a reset.

Problems

ProblemDifficultyPatternVideo
LC 128. Longest Consecutive SequenceMediumHash SetVideo
LC 146. LRU CacheMediumHash Map + DLLVideo
LC 380. Insert Delete GetRandom O(1)MediumHash Map + ArrayVideo
LC 560. Subarray Sum Equals KMediumPrefix Sum + MapVideo

Deliverables

  • Write a 1-line invariant for each problem.
  • Note 1 edge case or pitfall per problem.
  • Record time-to-first-correct solution.

Notes

  • LC 128: start only at sequence starts; expand with set lookups.
  • LC 146: hashmap + doubly linked list for O(1) get/put.
  • LC 380: array + hashmap; delete by swap-with-last.
  • LC 560: prefix sum counts; add count[sum - k] each step.

Review

  • Time spent + where you got stuck?
  • Biggest mistake or missed edge case?
  • One concrete improvement for next time.

Comments

Share your approach or ask questions

0 comments
?
|
Markdown supported
Sign in to post

Loading comments...