An integer interval [a, b] (for integers a < b) is a set of all consecutive integers …
分类:LeetCode题目解答
LeetCode | Flatten Binary Tree to Linked List
题目: Given a binary tree, flatten it to a linked list in-place. For example, Given 1 / \ 2 5 / \ \ 3 4 6 The fl…
LeetCode 152 Maximum Product Subarray
题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest produ…
【leetcode】70. Climbing Stairs 每次一阶或两阶爬楼梯
1. 题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or…
70. Climbing Stairs
70. Climbing Stairs 题目 You are climbing a stair case. It takes n steps to reach to the top. Each time you can …
[LeetCode] Merge k Sorted Lists 合并k个有序链表,Merge Two Sorted Lists 混合插入有序链表
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. &nbs…
[LeetCode] Duplicate Emails 重复的邮箱
Write a SQL query to find all duplicate emails in a table named Person. +----+---------+ | Id | Email |…
[LeetCode] Minimum Height Trees 最小高度树,Course Schedule 课程清单
For a undirected graph with tree characteristics, we can choose any node as the root. The result graph …
[LeetCode] Valid Word Square 验证单词平方
Given a sequence of words, check whether it forms a valid word square. A sequence of words forms a vali…
[Leetcode] Divide Two Integers 整数整除
Divide Two Integers Divide two integers without using multiplication, division and mod operator. If it is over…
[Leetcode] 3Sum Smaller 三数较小和
3Sum Smaller Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 …
[Leetcode] Restore IP Address 修复IP地址
Restore IP Address Given a string containing only digits, restore it by returning all possible valid IP addres…