自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(169)
  • 收藏
  • 关注

原创 [LeetCode] HashMap题目总结

1. Two Sum找出数组中加起来等于target的两个数。每一个输入有且仅有一个解,但是同一个元素不能使用两次。可以使用HashMap + 单遍循环,key为数组中的元素,value为下标。如果hashmap中已经存储过target - nums[i]了,那么就找到了一对结果。如果没有存储过target - nums[i],那么就将(nums[i] , i)放入HashMap。class...

2019-12-15 16:50:02 769

原创 [LeetCode] 118. Pascal's Triangle

原题链接:https://leetcode.com/problems/pascals-triangle/1. 题目介绍Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle.In Pascal’s triangle, each number is the sum of the...

2019-12-01 00:05:56 203

原创 [LeetCode] 273. Integer to English Words

原题链接:https://leetcode.com/problems/integer-to-english-words/1. DescriptionConvert a non-negative integer to its english words representation. Given input is guaranteed to be less than 231 - 1.Examp...

2019-09-27 11:35:34 218

原创 [LeetCode] 349. Intersection of Two Arrays

原题链接:https://leetcode.com/problems/intersection-of-two-arrays/1. DescriptionGiven two arrays, write a function to compute their intersection.Example 1:Input: nums1 = [1,2,2,1], nums2 = [2,2]Outpu...

2019-09-26 23:56:49 172

原创 [LeetCode] 543. Diameter of Binary Tree

原题链接:https://leetcode.com/problems/diameter-of-binary-tree/1. DescriptionGiven a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length ...

2019-09-26 23:53:07 178

原创 [LeetCode] 415. Add Strings

原题链接:https://leetcode.com/problems/add-strings/1. DescriptionGiven two non-negative integers num1 and num2 represented as string, return the sum of num1 and num2.Note:The length of both num1 and n...

2019-09-26 23:43:30 167

原创 [LeetCode] 9. Palindrome Number

原题链接:https://leetcode.com/problems/palindrome-number/1. DescriptionDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Inp...

2019-09-24 12:03:14 127

原创 [LeetCode] 253. Meeting Rooms II

原题链接:https://leetcode.com/problems/meeting-rooms-ii/1. DescriptionGiven an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), find the minimum number...

2019-09-24 11:16:02 171

原创 [LeetCode] 56. Merge Intervals

原题链接:https://leetcode.com/problems/merge-intervals/1. DescriptionGiven a collection of intervals, merge all overlapping intervals.Example 1:Input: [[1,3],[2,6],[8,10],[15,18]]Output: [[1,6],[8,10...

2019-09-23 07:56:35 162

原创 [LeetCode] 252. Meeting Rooms

原题链接:https://leetcode.com/problems/meeting-rooms/1. DescriptionGiven an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],…] (si < ei), determine if a person coul...

2019-09-23 06:32:02 237

原创 [LeetCode] 953. Verifying an Alien Dictionary

原题链接:https://leetcode.com/problems/verifying-an-alien-dictionary/1. DescriptionIn an alien language, surprisingly they also use english lowercase letters, but possibly in a different order. The orde...

2019-09-23 04:28:33 169

原创 [LeetCode] 1021. Remove Outermost Parentheses

原题链接:https://leetcode.com/problems/remove-outermost-parentheses/1. DescriptionA valid parentheses string is either empty (""), “(” + A + “)”, or A + B, where A and B are valid parentheses strings, a...

2019-09-23 04:01:33 174

原创 [LeetCode] 75. Sort Colors (Quick Sort)

1. DescriptionGiven an array with n objects colored red, white or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order red, white and blue.Here, we w...

2019-09-12 05:15:08 195

原创 [LeetCode] 454. 4Sum II

原题链接: https://leetcode.com/problems/4sum-ii/1. 题目介绍Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make ...

2019-07-31 18:41:07 146

原创 [LeetCode] 28. Implement strStr()

原题链接:

2019-07-26 16:44:20 152

原创 [LeetCode] 80. Remove Duplicates from Sorted Array II

原题链接:https://leetcode.com/problems/remove-element/1. 题目介绍Given an array nums and a value val, remove all instances of that value in-place and return the new length.Do not allocate extra space for a...

2019-07-25 23:05:55 145

原创 [LeetCode] 283. Move Zeroes

原题链接:https://leetcode.com/problems/move-zeroes/1. 题目介绍Given an array nums, write a function to move all 0’s to the end of it while maintaining the relative order of the non-zero elements.给出一个数组nums...

2019-07-24 22:04:24 130

原创 [LeetCode] 42. Trapping Rain Water

1. 题目介绍Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.给出n个非负整数组成的数组,代表了一个柱状图中各柱子的高度。每一个柱子的宽度都是1...

2019-07-21 22:16:34 156

原创 [LeetCode] 11. Container With Most Water

原题链接:1. 题目介绍2. 解题思路

2019-07-21 17:36:22 185

原创 [LeetCode] 22. Generate Parentheses

原题链接

2019-07-17 22:09:24 142

原创 [LeetCode] 654. Maximum Binary Tree

原题链接:1. 题目介绍2. 解题思路

2019-07-17 11:32:05 114

原创 [LeetCode] 116. Populating Next Right Pointers in Each Node

原题链接:

2019-07-02 23:34:42 141

原创 [LeetCode] 114. Flatten Binary Tree to Linked List

原题链接:1. 题目介绍2. 解题思路

2019-07-01 23:45:36 139

原创 [LeetCode] 108. Convert Sorted Array to Binary Search Tree

原题链接:1. 题目介绍2. 解题思路

2019-06-30 09:48:05 139

原创 [LeetCode] 701. Insert into a Binary Search Tree

原题链接:

2019-06-29 22:08:06 166

原创 [LeetCode] 107. Binary Tree Level Order Traversal II

原题链接:1. 题目介绍2. 解题思路

2019-06-29 17:59:07 138

原创 [LeetCode] 106. Construct Binary Tree from Inorder and Postorder Traversal

原题链接:1. 题目介绍2. 解题思路

2019-06-28 17:35:23 140

原创 [LeetCode] 105. Construct Binary Tree from Preorder and Inorder Traversal

原题链接:

2019-06-28 16:11:16 165

原创 [LeetCode] 103. Binary Tree Zigzag Level Order Traversal

原题链接:

2019-06-27 13:06:31 182

原创 [LeetCode] 988. Smallest String Starting From Leaf

原题链接:https://leetcode.com/problems/smallest-string-starting-from-leaf/

2019-06-25 23:46:44 254

原创 [LeetCode] 865. Smallest Subtree with all the Deepest Nodes

原题链接:https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/1. 题目介绍Given a binary tree rooted at root, the depth of each node is the shortest distance to the root.A node is deepe...

2019-06-17 02:01:54 215

原创 [LeetCode] 572. Subtree of Another Tree

原题链接:

2019-06-16 21:06:22 178

原创 [LeetCode] 1022. Sum of Root To Leaf Binary Numbers

原题链接

2019-06-16 17:37:02 325

原创 [LeetCode] 129. Sum Root to Leaf Numbers

原题链接

2019-06-16 17:00:21 199

原创 [LeetCode] 101. Symmetric Tree

原题链接:https://leetcode.com/problems/symmetric-tree/1. 题目介绍Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).给定一个二叉树,检查是否是中心对称的。For example, this binary t...

2019-06-15 12:52:04 146

原创 [LeetCode] 437. Path Sum III

原题链接

2019-06-15 03:02:35 154

原创 [LeetCode] 987. Vertical Order Traversal of a Binary Tree

原题链接:https://leetcode.com/problems/vertical-order-traversal-of-a-binary-tree/1. 题目介绍Given a binary tree, return the vertical order traversal of its nodes values.For each node at position (X, Y), it...

2019-06-15 02:55:40 243

原创 [LeetCode] 563. Binary Tree Tilt

原题链接:

2019-06-11 23:25:38 158

原创 [LeetCode] 113. Path Sum II

原题链接:?

2019-06-11 19:24:06 191

原创 [LeetCode] 897. Increasing Order Search Tree

原题链接: https://leetcode.com/problems/increasing-order-search-tree/

2019-06-11 16:46:31 233

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除