Arrays & Hashing
31 animated solutionsThe foundation: scanning arrays and using hash maps and sets to trade memory for speed. These patterns answer most 'have I seen this before?' questions in O(1) per lookup. Every problem below plays as an animated walkthrough with solutions in Python, Java and C++. Companies that ask these most: Yelp, Wissen Technology, Yahoo.
Contains Duplicate
Contains Duplicate II
Find the Index of the First Occurrence in a String
Isomorphic Strings
Length of Last Word
Longest Common Prefix
Majority Element
Merge Sorted Array
Ransom Note
Remove Duplicates from Sorted Array
Remove Element
Roman to Integer
Two Sum
Valid Anagram
Word Pattern
Best Time to Buy and Sell Stock II
Encode and Decode Strings
Group Anagrams
H-Index
Insert Delete GetRandom O(1)
Integer to Roman
Longest Consecutive Sequence
Product of Array Except Self
Remove Duplicates from Sorted Array II
Reverse Words in a String
Rotate Array
Top K Frequent Elements
Valid Sudoku
Zigzag Conversion
Candy
Text Justification