For this question, we need to consider a case when word A and word B both have a same c...
For this question, we need to consider a case when word A and word B both have a same c...
This problem can be simplified to an n shortest distance problem. We start from arr[0][...
This question is actually asking how to check whether a graph has a cycle: 1. Put all n...
For each node, there may be several conditions: 1. root.left <0 and root.right <0, the ...
For this problem, we divide it into 2 parts, reverse LinkedList and connect. Reverse: R...
For this problem, we take use of the sliding window. First we should search characters ...
We divide the number every 4 digits, for each interval, it's xxx hundreds + ( xxxty + n...
For this problem, we can scan all the people in one-pass. From people 0, we find the cl...
For LRU cache, it's like a fifo queue but reassign the existing value to the first if w...
For this question, we should first consider how does deletion in binary tree works in a...
When I first see this question, I was thinking about whether top-down or bottom-up recu...
Given an unsorted array of integers, find the length of the longest increasing subseque...