Given a binary tree, return the inorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \…
标签:LeetCode题目解答
【leetcode】46. Permutations 无重复数组的所有组合形式
1. 题目 Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the f…
LeetCode 104 Maximum Depth of Binary Tree
题目描述 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest p…
114. Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / …
[LeetCode] Reverse Integer 翻转整数
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to sh…
LeetCode | Remove Nth Node From End of List
题目: Given a linked list, remove the nth node from the end of list and return its head. For example, …
力扣(LeetCode)56
题目地址:https://leetcode-cn.com/probl…题目描述:给出一个区间的集合,请合并所有重叠的区间。 示例 1: 输入: [[1,3],[2,6],[8,10],[15,18]]输出: …
[LeetCode] Partition Labels 分割标签
A string S of lowercase letters is given. We want to partition this string into as many parts…
LeetCode | Clone Graph
题目: Clone an undirected graph. Each node in the graph contains a label and a list of its neighb…
LeetCode 297 Serialize and Deserialize Binary Tree
题目描述 Serialization is the process of converting a data structure or object into a sequence of bits so that it …
LeetCode 053 Maximum Subarray
题目描述 Find the contiguous subarray within an array (containing at least one number) which has the largest sum. …
[LeetCode] Sentence Screen Fitting 调整屏幕上的句子
Given a rows x cols screen and a sentence represented by a list of words, find how many …