Heap
weixin_39145266
这个作者很懒,什么都没留下…
展开
-
239 Sliding Window Maximum
1 题目Given an arraynums, there is a sliding window of sizekwhich is moving from the very left of the array to the very right. You can only see theknumbers in the window. Each time the sliding wi...原创 2019-12-20 06:40:09 · 60 阅读 · 0 评论 -
295 Find Median from Data Stream
1 题目Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.For example,[2,3,4], the m...原创 2019-12-05 12:12:19 · 64 阅读 · 0 评论 -
759 Employee Free Time
1 题目We are given a listscheduleof employees, which represents the working time for each employee.Each employee has a list of non-overlappingIntervals, and these intervals are in sorted order....原创 2019-12-05 10:19:37 · 81 阅读 · 0 评论 -
253 Meeting Rooms II
1 题目Given an array of meeting time intervals consisting of start and end times[[s1,e1],[s2,e2],...](si< ei), find the minimum number of conference rooms required.Example 1:Input: [[0, 30]...原创 2019-12-05 07:06:08 · 54 阅读 · 0 评论 -
23 Merge k Sorted Lists
1 题目Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1->1->2->3-...原创 2019-12-01 15:06:16 · 57 阅读 · 0 评论 -
692 Top K Frequent Words
1 题目Given a non-empty list of words, return thekmost frequent elements.Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then the word with ...原创 2019-11-26 12:54:55 · 47 阅读 · 0 评论 -
1046 Last Stone Weight
1 题目We have a collection of rocks, each rock has a positive integer weight.Each turn, we choose the twoheaviestrocksand smash them together. Suppose the stones have weightsxandywithx <...原创 2019-08-10 18:56:59 · 54 阅读 · 0 评论 -
378 Kth Smallest Element in a Sorted Matrix Medium
1 题目Given anxnmatrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order,...原创 2019-07-10 20:37:32 · 61 阅读 · 0 评论 -
313 Super Ugly Number
1 题目Write a program to find thenthsuper ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime listprimesof sizek.Example:Input: n = 12, prime...原创 2019-05-07 17:51:53 · 61 阅读 · 0 评论 -
215 Kth Largest Element in an Array
1 题目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.Example 1:Input: [3,2,1,5,6,4] and k = 2Output:...原创 2019-04-16 16:22:33 · 76 阅读 · 0 评论 -
264 Ugly Number II
1 题目Write a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. Example:Input: n = 10Output: 12Explanation: 1, 2, 3, 4, 5, 6, 8,...原创 2019-04-11 21:47:42 · 63 阅读 · 0 评论