Given a binary tree, return a deep copy of it.
Given two strings, find the length of the longest common subsequence (LCS).
Implement a trie with insert, search, and startsWith methods.
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a roman numeral, convert it to an integer.
Given an integer, in the range of 1 to 3999, convert it to a Roman numeral.
Given an integer array
A, a peak element with index
p is defined as
A[p] > A[p - 1] && A[p] > A[p + 1]. Find a peak element in this array and return its index. The array may contains multiple peeks; return any of them.
Given a directed graph, design an algorithm to find out whether there is a route between two nodes.
Given a string which contains only letters. Sort it by lower case first and upper case second.
Singleton is a most widely used design pattern. If a class has and only has one instance at every moment, we call this design as singleton. For example, for class Mouse (not a animal mouse), we should design it in singleton.