Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 &nbs…
分类:LeetCode题目解答
[LeetCode] Shortest Word Distance 最短单词距离
Given a list of words and two words word1 and word2, return the shortest distance betwee…
LeetCode | Jump Game
题目: Given an array of non-negative integers, you are initially positioned at the first index of the array. Eac…
[Leetcode] Repeated DNA Sequences 重复DNA序列
Repeated DNA Sequences All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for examp…
【leetcode】97. Interleaving String 字符串c是否是字符串a、b的交叉结果
1. 题目 Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Given:s1 = …
57. Insert Interval
57. Insert Interval 题目 Given a set of non-overlapping intervals, insert a new interval into the intervals (mer…
39. Combination Sum
39. Combination Sum 题目 Given a set of candidate numbers (C) (without duplicates) and a target number (T), find…
[LeetCode] Construct Binary Tree from Preorder and Inorder Traversal 由先序和中序遍历建立二叉树
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that dup…
[LeetCode] Largest Sum of Averages 最大的平均数之和
We partition a row of numbers A into at most K adjacent (non-empty) groups, then ou…
LeetCode | Count and Say
题目: The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ... 1…
LeetCode | Surrounded Regions
题目: Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'. A regi…
[Leetcode] Find Median from Data Stream 数据流中位数
Data Stream Median 最新更新:https://yanjia.me/zh/2019/02/… Median is the middle value in an ordered integer …