Skip to main content

๐ŸŽฎ Hash Maps (Practice)

Companion to the Hash Maps & Sets guide. Use a hash map to turn an O(nยฒ) scan into a single O(n) pass. Edit and run the code right here โ€” it executes in your browser.

๐Ÿ Your turnโ€‹

Loading editorโ€ฆ

๐Ÿง  Challenge yourselfโ€‹

  1. Group a list of words into anagrams using a hash map.
  2. Find the first non-repeating character in a string.
  3. Why is average lookup O(1) but worst case O(n)?

Continue the learning path โ†’ Linked Lists