# LeetCode
# 1. Two Sum
Using a hash map to check whether the target - n exists.
1 | |
# 3. Longest Substring Without Repeating Characters
An intuitive solution is using a map to record the index of each letter. When find a duplicated letter move the lower bound the max(lower, index) and calculate the length.
1 | |
# 1002. Find Common Characters
1 | |
# 350. Intersection of Two Arrays II
Repeat element.
1 | |
# 349. Intersection of Two Arrays
Unique element.
1 | |
# 146. LRU Cache
combination of list & map, try to avoid search.
1 | |
# 49. Group Anagrams
1 | |
# 242. Valid Anagram
1 | |
# 208. Implement Trie (Prefix Tree)
1 | |