heap
Goofiness
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LeetCode]Kth Largest Element in a Stream@Python
Kth Largest Element in a StreamDesign a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element.Your KthLargest ...原创 2019-05-05 10:55:03 · 323 阅读 · 0 评论 -
[LeetCode]Last Stone Weight@Python
Last Stone WeightWe have a collection of rocks, each rock has a positive integer weight.Each turn, we choose the two heaviest rocks and smash them together. Suppose the stones have weights x and y...原创 2019-05-22 09:33:11 · 352 阅读 · 0 评论 -
[LeetCode]Network Delay Time@Python
Network Delay TimeThere 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 t...原创 2019-05-16 00:13:28 · 192 阅读 · 0 评论 -
[LeetCode]Top K Frequent Words@Python
Top K Frequent WordsGiven a non-empty list of words, return the k most frequent elements.Your answer should be sorted by frequency from highest to lowest. If two words have the same frequency, then...原创 2019-05-14 23:27:36 · 174 阅读 · 0 评论 -
K Closest Points to Origin
K Closest Points to OriginWe have a list of points on the plane. Find the K closest points to the origin (0, 0).(Here, the distance between two points on a plane is the Euclidean distance.)You ma...原创 2019-05-19 21:21:22 · 228 阅读 · 0 评论 -
[LeetCode]Cheapest Flights Within K Stops@Python
Cheapest Flights Within K StopsThere are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w.Now given all the cities and flights, together with starting ...原创 2019-05-19 21:11:28 · 202 阅读 · 0 评论 -
[LeetCode]Split Array into Consecutive Subsequences@Python
Split Array into Consecutive SubsequencesYou are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subsequences ...原创 2019-05-14 10:08:56 · 162 阅读 · 0 评论 -
[LeetCode]Find K Pairs with Smallest Sums@Python
Find K Pairs with Smallest SumsYou are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k.Define a pair (u,v) which consists of one element from the first array and...原创 2019-05-09 06:32:25 · 222 阅读 · 0 评论 -
[LeetCode]Kth Largest Element in an Array@Python
Kth Largest Element in an ArrayFind 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.ExampleInput: [3,2,1,5...原创 2019-05-05 11:20:13 · 227 阅读 · 0 评论 -
[LeetCode]Sort Characters By Frequency@Python
Sort Characters By FrequencyGiven a string, sort it in decreasing order based on the frequency of characters.ExampleInput:“tree”Output:“eert”Explanation:‘e’ appears twice while ‘r’ and ...原创 2019-05-12 23:20:32 · 207 阅读 · 0 评论
分享