![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
qq_24896641
这个作者很懒,什么都没留下…
展开
-
[leetcode]406. Queue Reconstruction by Height
greedy题目: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 height of the person and k is the number of people in front原创 2017-11-07 12:19:07 · 123 阅读 · 0 评论 -
[leetcode]435. Non-overlapping Intervals
greedy题目:Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note: You may assume the interval’s end point is alw原创 2017-11-21 22:34:12 · 127 阅读 · 0 评论 -
[LeetCode] 617. Merge Two Binary Tree
题目:Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree原创 2017-11-20 16:24:45 · 186 阅读 · 0 评论 -
[leetcode]215. Kth Largest Element in an Array
divide and conquer题目:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given [3,2,1,5,6,4] and k原创 2017-11-05 22:51:46 · 141 阅读 · 0 评论 -
[leetcode]169. Majority Element
题目描述:Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the array is non-empty and the majority element原创 2017-11-04 17:18:51 · 183 阅读 · 0 评论 -
[leetcode]241. Different Ways to Add Parentheses
题目描述:Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators. The valid operators are +, - and *.Example 1 In原创 2017-11-04 18:11:52 · 136 阅读 · 0 评论 -
[leetcode]312. Burst Balloons
题目:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[原创 2017-11-05 17:32:37 · 145 阅读 · 0 评论 -
[leetcode]53. Maximum Subarray
题目:Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [-2,1,-3,4,-1,2,1,-5,4], the contiguous subarray [4,-1,2,1] has原创 2017-11-05 18:14:55 · 133 阅读 · 0 评论 -
[leetcode]452. Minimum Number of Arrows to Burst Balloons
greedy题目:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it’s horizontal, y原创 2017-11-08 17:42:59 · 184 阅读 · 0 评论 -
[leetcode]392. Is Subsequence
题目:Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) strin原创 2017-11-08 16:54:40 · 114 阅读 · 0 评论 -
[leetcode]455. Assign Cookies
greedy题目: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 gi, which is the minimum size原创 2017-11-08 16:33:46 · 124 阅读 · 0 评论 -
[leetcode]122. Best Time to Buy and Sell Stock II
greedy题目:Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the s原创 2017-11-08 16:14:05 · 144 阅读 · 0 评论 -
[leetcode]651. 4 Keys Keyboard
dynamic programming题目:Imagine you have a special keyboard with the following keys: Key 1: (A): Prints one ‘A’ on screen. Key 2: (Ctrl-A): Select the whole screen. Key 3: (Ctrl-C): Copy selection to原创 2017-11-07 23:39:59 · 426 阅读 · 0 评论 -
[leetcode]484.Find Permutation
greedy题目:By now, you are given a secret signature consisting of character ‘D’ and ‘I’. ‘D’ represents a decreasing relationship between two numbers, ‘I’ represents an increasing relationship between tw原创 2017-11-07 16:22:28 · 480 阅读 · 0 评论 -
[leetcode]714. Best Time to Buy and Sell Stock with Transaction Fee
dynamic programming题目:Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee.You ma原创 2017-11-22 15:01:27 · 149 阅读 · 0 评论