![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
T_tangc
这个作者很懒,什么都没留下…
展开
-
102. Binary Tree Level Order Traversal
题目:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree [3,9,20,null,null,15,7], 3 / \ 9 ...原创 2018-08-31 09:55:45 · 276 阅读 · 0 评论 -
5. Longest Palindromic Substring
题目:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example 1:Input: “babad”Output: “bab”Note: “aba” is also a valid answer.Exam...原创 2018-11-25 19:45:57 · 252 阅读 · 0 评论 -
110. Balanced Binary Tree
题目:Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as:a binary tree in which the depth of the two subtrees of every node never...原创 2018-09-03 20:44:09 · 124 阅读 · 0 评论 -
199. Binary Tree Right Side View
题目:Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.Example:Input: [1,2,3,null,5,null,4]Output: [1,...原创 2018-09-03 20:06:43 · 208 阅读 · 0 评论 -
279. Perfect Squares
题目:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.Example 1:Input: n = 12Output: 3 Explanation: 12 = 4 + 4 + 4.Ex...原创 2018-09-02 18:36:04 · 128 阅读 · 0 评论 -
257. Binary Tree Paths
题目:Given a binary tree, return all root-to-leaf paths.Note: A leaf is a node with no children.Example:Input: 1 / \2 3 \ 5Output: ["1->2->5", "1->3"]Explanation: Al...原创 2018-09-02 17:51:50 · 126 阅读 · 0 评论 -
103. Binary Tree Zigzag Level Order Traversal
题目:Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).For example:Given binar...原创 2018-09-04 19:57:20 · 241 阅读 · 0 评论 -
112. Path Sum
题目:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Note: A leaf is a node with no children.Exa...原创 2018-09-04 19:18:38 · 205 阅读 · 0 评论 -
101. Symmetric Tree
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3...原创 2018-08-29 22:08:56 · 184 阅读 · 0 评论 -
111. Minimum Depth of Binary Tree
题目:Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.Note: A leaf is a node with no ch...原创 2018-08-31 17:13:39 · 204 阅读 · 0 评论 -
4. Median of Two Sorted Arrays
题目There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).You may assume nums1 and ...原创 2018-11-27 17:12:07 · 230 阅读 · 0 评论