![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
优先队列
文章平均质量分 85
ForABiggerWorld
这个作者很懒,什么都没留下…
展开
-
1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows
You are given anm* nmatrix,mat, and an integerk,whichhas its rows sorted in non-decreasingorder.You are allowed to choose exactly 1 element from each row to form an array.Return the Kthsma...原创 2020-05-05 22:28:59 · 466 阅读 · 0 评论 -
1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Given anarray of integersnumsand anintegerlimit, return the size of the longest continuous subarray such that the absolute difference between any two elements is less than or equal tolimit.In ...原创 2020-05-05 22:28:01 · 429 阅读 · 0 评论 -
1425. Constrained Subsequence Sum
Given an integer arraynumsand an integerk, return the maximum sum of anon-emptysubsequenceof that array such that for everytwoconsecutiveintegers in the subsequence,nums[i]andnums[j], wher...原创 2020-05-01 22:24:50 · 412 阅读 · 0 评论 -
1405. Longest Happy String
A string is calledhappyif it doesnot have any of the strings'aaa','bbb'or'ccc'as a substring.Given three integersa,bandc, returnanystrings,which satisfies following conditions:sis...原创 2020-04-07 21:59:29 · 260 阅读 · 0 评论 -
1172. Dinner Plate Stacks
You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the samemaximumcapacity.Implement theDinnerPlatesclass:DinnerPlates(int capa...原创 2019-08-25 13:54:14 · 434 阅读 · 0 评论 -
1054. Distant Barcodes
In a warehouse, there is a row of barcodes, where thei-th barcode isbarcodes[i].Rearrange the barcodes so that no two adjacent barcodes are equal. You may return any answer, and it is guaranteed ...原创 2019-05-26 12:00:09 · 376 阅读 · 0 评论 -
895. Maximum Frequency Stack
Implement FreqStack, a class which simulates the operation of a stack-like data structure.FreqStack has two functions:push(int x), which pushes an integer x onto the stack. pop(), which removes a...原创 2018-08-27 10:30:52 · 334 阅读 · 0 评论 -
743. Network Delay Time
There are N network nodes, labelled 1 to N.Given times, a list of travel times as directed edges times[i] = (u, v, w), where u is the source node, v is the target node, and w is the time it takes fo...原创 2018-08-16 09:54:49 · 107 阅读 · 0 评论 -
857. Minimum Cost to Hire K Workers
There are N workers. The i-th worker has a quality[i] and a minimum wage expectation wage[i].Now we want to hire exactly K workers to form a paid group. When hiring a group of K workers, we must pay...原创 2018-06-24 11:44:31 · 1529 阅读 · 0 评论 -
625. Minimum Factorization & 621. Task Scheduler
思路:子所以把这两个题放在一起,感觉都要贪心的一个概念Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a.If there is no answer or the answer is not fit原创 2017-06-18 14:05:15 · 732 阅读 · 0 评论 -
407. Trapping Rain Water II
Given an m x n matrix of positive integers representing the height of each unit cell in a 2D elevation map, compute the volume of water it is able to trap after raining.Note:Both m and n are less than...原创 2018-04-24 19:58:34 · 155 阅读 · 0 评论 -
630. Course Schedule III
There are n different online courses numbered from 1 to n. Each course has some duration(course length) t and closed on dthday. A course should be taken continuously for t days and must be finished be...原创 2017-06-25 17:38:46 · 1134 阅读 · 0 评论 -
786. K-th Smallest Prime Fraction
A sorted list A contains 1, plus some number of primes. Then, for every p < q in the list, we consider the fraction p/q.What is the K-th smallest fraction considered? Return your answer as an arr...原创 2018-02-21 10:04:24 · 380 阅读 · 0 评论 -
759. Employee Free Time
We are given a list schedule of employees, which represents the working time for each employee.Each employee has a list of non-overlapping Intervals, and these intervals are in sorted order.Re原创 2018-01-08 21:30:45 · 569 阅读 · 0 评论 -
767. Reorganize String
Given a string S, check if the letters can be rearranged so that two characters that are adjacent to each other are not the same.If possible, output any possible result. If not possible, return原创 2018-01-21 13:21:19 · 812 阅读 · 0 评论 -
218. The Skyline Problem
A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are given the locations and height of all the buildings as原创 2017-10-14 13:58:18 · 248 阅读 · 0 评论