- Problem Description: Given an array of clouds(
0
and1
), person can jump1
or2
per time. Finding the minimum jumps - Concept: Applying
dynamic programming
- Problem Description: we are looking for the indexes of two number which sum is the targets input.
- Concept: use
HashMap
to preload the given number data and its supplement. Which will get the values in constant time.
- Problem Description: given two
linked list
numbers, finding the sum as another linked list - Concept: recursively call the method to add each digit, once need to carry
1
, first take care of the digit where overflowed, then add a node of 1 to the next node
- Problem Description: as title said
- Concept: the key is to send alert once find the overlapped sequence, since it's finding the non-overlapped sequence, we can use a set which will have no overlapped elements rather than list all possibilities
- Problem Description: as title said, The
overall run time complexity should be O(log (m+n))
, once we havelog
then it's has high probability of a varsity ofbinary search
- Concept: In this problem, we divide each array by
half
, since each array issorted
, the first half will always less than the second part, we set the shorter array always be the first array A, compare the middle element, if big move the ptr left by one for in the shorter array. If small move right in shorter array. Once all the elements on the left of ptr is less than or equal to the elements on the right. We can say that we've almost found median. If the new combined array hasodd
numbers of elements, the median will be themaximum of the left part
of the ptr. If it haseven
number of elements, we have edge cases that these two numbers might indifferent arrays
in origin, either far right or far left, or normal case that it's in same array.