LeetCode Hashmap, HashSet Problems and Solutions

Sometimes 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.

Problems and Solutions: