LeetCode
文章平均质量分 66
ugt278
这个作者很懒,什么都没留下…
展开
-
LeetCode---513. Find Bottom Left Tree Value(DFS)
Find Bottom Left Tree Value(Depth-first-search)Given a binary tree, find the leftmost value in the last row of the treeExample 1: Input: 2 / \ 1 3 Output: 1Example 2: Input: 1 / \ 2原创 2017-09-24 17:50:50 · 153 阅读 · 0 评论 -
LeetCode--123. Best Time to Buy and Sell Stock III
123. Best Time to Buy and Sell Stock IIIDescription:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profi原创 2018-01-10 21:57:39 · 208 阅读 · 0 评论 -
LeetCode--111. Minimum Depth of Binary Tree
111. Minimum Depth of Binary TreeDescription: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原创 2018-01-12 15:50:16 · 191 阅读 · 0 评论 -
LeetCode--55. Jump Game
55. Jump GameDescription:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum j原创 2018-01-12 15:10:48 · 155 阅读 · 0 评论 -
LeetCode--63. Unique Paths II
63. Unique Paths IIDescription:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty原创 2018-01-10 22:40:37 · 145 阅读 · 0 评论 -
LeetCode--62. Unique Paths
62. Unique PathsDescription:A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any po原创 2018-01-10 22:23:26 · 112 阅读 · 0 评论 -
LeetCode--455. Assign Cookies
455. Assign CookiesDescription:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor原创 2017-11-30 11:23:55 · 165 阅读 · 0 评论 -
LeetCode--122. Best Time to Buy and Sell Stock II
Best Time to Buy and Sell Stock IIDescription:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You m原创 2017-11-30 10:42:40 · 144 阅读 · 0 评论 -
LeetCode--324. Wiggle Sort II
Wiggle Sort IIDescriptionGiven an unsorted array nums, reorder it such that nums[0] nums[2] .Example:(1) Given nums = [1, 5, 1, 1, 6, 4], one possible answer is [1, 4, 1, 5, 1, 6]原创 2017-11-02 11:08:26 · 234 阅读 · 0 评论 -
LeetCode--349. Intersection of Two Arrays
349. Intersection of Two ArraysDescription:Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2].Not原创 2017-11-02 10:23:23 · 205 阅读 · 0 评论 -
LeetCode--406. Queue Reconstruction by Height
LeetCode--406. Queue Reconstruction by HeightDescription:Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the h原创 2017-10-22 21:29:18 · 183 阅读 · 0 评论 -
LeetCode--169. Majority Element (Divide-and-Conquer)
分治算法Majority Element原创 2017-09-10 18:47:17 · 279 阅读 · 0 评论 -
LeetCode--350. Intersection of Two Arrays II
350. Intersection of Two Arrays IIDescriptionGiven two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].原创 2017-10-29 20:28:52 · 185 阅读 · 0 评论 -
LeetCode--240. Search a 2D Matrix II
240. Search a 2D Matrix IIDescription:Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row a原创 2018-01-10 22:09:59 · 126 阅读 · 0 评论