Lin Duan
Lin Duan
[**题目**](https://leetcode.com/problems/longest-increasing-subsequence/) Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is...
https://leetcode.com/problems/cheapest-flights-within-k-stops/ > Example 1: > Input: > n = 3, edges = [[0,1,100],[1,2,100],[0,2,500]] > src = 0, dst = 2, k = 1 > Output: 200 > Explanation: > The...
> Design a hit counter which counts the number of hits received in the past 5 minutes. > > Each function accepts a timestamp parameter (in seconds granularity) and you...
https://leetcode.com/problems/minimum-swaps-to-make-sequences-increasing/ ### 题目 We have two integer sequences A and B of the same non-zero length. We are allowed to swap elements A[i] and B[i]. Note that both elements are...
https://leetcode.com/problems/restore-ip-addresses/ > Given a string containing only digits, restore it by returning all possible valid IP address combinations. > > A valid IP address consists of exactly four integers (each...
参考:https://www.youtube.com/watch?v=ScCg9v921ns  ## Binary Search ```java class Solution { public double findMedianSortedArrays(int[] A, int[] B) { int lenA = A.length, lenB = B.length; if (lenA > lenB) { return findMedianSortedArrays(B,A);...
There are `n` servers numbered from `0` to `n-1` connected by undirected server-to-server `connections` forming a network where `connections[i] = [a, b]` represents a connection between servers `a` and `b`....
You are given a **perfect binary tree** where all leaves are on the same level, and every parent has two children. The binary tree has the following definition: ``` struct...
Validate if a given string can be interpreted as a decimal number. Some examples: `"0"` => `true` `" 0.1 "` => `true` `"abc"` => `false` `"1 a"` => `false` `"2e10"`...