Source: https://leetcode.com/problems/intersection-of-two-arrays-ii/

Given two arrays, write a function to compute their intersection.

Read MoreSource: https://leetcode.com/problems/intersection-of-two-arrays-ii/

Given two arrays, write a function to compute their intersection.

Read MoreSource: https://leetcode.com/problems/top-k-frequent-elements/

Given a non-empty array of integers, return the ** k** most frequent elements.

Source: https://leetcode.com/problems/contains-duplicate-ii/

Given an array of integers and an integer *k*, find out whether there are two distinct indices *i* and *j* in the array such that **nums[i] = nums[j]**and the **absolute** difference between *i* and *j* is at most *k*.

Source：https://leetcode.com/problems/happy-number/

Write an algorithm to determine if a number is “happy”.

Read MoreGiven an array of strings, group anagrams together.

Read MoreSometimes we need a data structure, it can save and retrieve data rapidly. In lots of circumstances, a hashtable is our best choice. Hashtable is a complex dynamic data structure, in the best situation is saving and retrieving time complexity is O(1).

In this article, we don’t discuss the implementation of the hashtable, We only collect the problems of the hashtable.

Some problems suit for the hashtable, like problems related string, may also suit for array solution. We may choose an array to solve these problems, but we can also use hashtable either.

- 1. Two Sum (Java)
- 3. Longest Substring Without Repeating Characters
- 30. Substring with Concatenation of All Words
- 36. Valid Sudoku
- 49. Group Anagrams
- 136. Single Number
- 202. Happy Number
- 205. Isomorphic Strings
- 217. Contains Duplicate
- 219. Contains Duplicate II
- 290. Word Pattern
- 299. Bulls and Cows
- 347. Top K Frequent Elements
- 349. Intersection of Two Arrays
- 350. Intersection of Two Arrays II
- 355. Design Twitter

Source: https://leetcode.com/problems/backspace-string-compare/

Given two strings `S`

and `T`

, return if they are equal when both are typed into empty text editors. `#`

means a backspace character.

Source: https://leetcode.com/problems/flatten-nested-list-iterator/

Given a nested list of integers, implement an iterator to flatten it.

Each element is either an integer, or a list — whose elements may also be integers or other lists.

Read MoreSource: https://leetcode.com/problems/implement-queue-using-stacks/

Implement the following operations of a queue using stacks.

- push(x) — Push element x to the back of queue.
- pop() — Removes the element from in front of queue.
- peek() — Get the front element.
- empty() — Return whether the queue is empty.

Source: https://leetcode.com/problems/implement-stack-using-queues/

Implement the following operations of a stack using queues.

- push(x) — Push element x onto stack.
- pop() — Removes the element on top of the stack.
- top() — Get the top element.
- empty() — Return whether the stack is empty.