Given a non-empty array of integers, every element appears twice except for one. Find that single one.Read More
Determine if a 9×9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
3x3sub-boxes of the grid must contain the digits
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.
Given two strings
T, return if they are equal when both are typed into empty text editors.
#means a backspace character.
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 More
Implement the following operations of a queue using stacks.
Implement the following operations of a stack using queues.