28 Hash Table or Set
HashMap 有两种处理collision的方式,一种叫open, 如果位置被占了,就顺着找隔壁的;另一种叫close,如果位置被占了,就拉一条链表加进去。在resize的时候,记得重新把所有元素hash一边。
L389 Valid Sudoku (36)
1 Two Sum(L56)
L138 Subarray Sum -- hash
L405 Submatrix Sum --L138进化版
314 Binary Tree Vertical Order Traversal
987 Vertical Order Traversal of a Binary Tree -- 解法同上
Amicable Pair less than n-- snapchat
451 Sort Characters By Frequency
128 Longest Consecutive Sequence(L124)
358 Rearrange String k Distance Apart
767 Reorganize String == Rearrange chars in string such that no 2 adjacent are the same 是上一题 358 Rearrange String k distance apart 的简化版
525 Contiguous Array -- cc189 17.5 Letters and Numbers
187 Repeated DNA Sequences -- can use rolling hash as well
220 Contains Duplicate III -- TreeMap or bucket sort
349 Intersection of Two Arrays
350 Intersection of Two Arrays II
599 Minimum Index Sum of Two Lists
387 First Unique Character in a String
274 H-Index -- 桶排序
Pramp - Getting a Different Number -- S:O(1)的解法好熟,但忘了哪里见过。有空补链接。
1640 Check Array Formation Through Concatenation
1657 Determine if Two Strings Are Close
1461 Check If a String Contains All Binary Codes of Size K
1394 Find Lucky Integer in an Array
1198 Find Smallest Common Element in All Rows
2395 Find Subarrays With Equal Sum
other related:
37 Sudoku solver -- search
Last updated