leetcode堆
Bryan要加油
这个作者很懒,什么都没留下…
展开
-
295. Find Median from Data Stream[Hard](Leetcode每日一题-2021.08.27)
Problem原创 2021-09-01 20:24:40 · 166 阅读 · 0 评论 -
313. Super Ugly Number[Medium](Leetcode每日一题-2021.08.09)
111原创 2021-08-17 20:03:36 · 164 阅读 · 0 评论 -
692. Top K Frequent Words[Medium](Leetcode每日一题-2021.05.20)
ProblemGiven 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 the word with the lower alphabetical order comes first.Note:You ma原创 2021-05-20 08:39:25 · 267 阅读 · 0 评论 -
703. Kth Largest Element in a Stream(Leetcode每日一题-2021.02.11)
ProblemDesign 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.Implement KthLargest class:KthLargest(int k, int[] nums) Initializes the object with the integer原创 2021-02-11 09:53:16 · 172 阅读 · 0 评论 -
480. Sliding Window Median(Leetcode每日一题-2021.02.03)--抄答案
ProblemMedian 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.Examples:[2,3,4] , the median is 3[2,3], the median is (2 + 3) / 2 = 2.5Given an原创 2021-02-03 19:32:53 · 191 阅读 · 0 评论 -
1046. Last Stone Weight(Leetcode每日一题-2020.12.30)
ProblemWe have a collection of stones, each stone has a positive integer weight.Each turn, we choose the two heaviest stones and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is:If x == y, both原创 2020-12-30 21:14:57 · 112 阅读 · 0 评论 -
767. Reorganize String(Leetcode每日一题-2020.11.30)--抄答案
ProblemGiven 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 the empty string.Note:S will consist of lowercase原创 2020-11-30 21:13:16 · 214 阅读 · 0 评论 -
973. K Closest Points to Origin(Leetcode每日一题-2020.11.09)
ProblemWe 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 may return the answer in any order. The answer is guaranteed to be unique (ex原创 2020-11-09 21:35:34 · 242 阅读 · 0 评论 -
347. Top K Frequent Elements(Leetcode每日一题-2020.09.07)
ProblemGiven a non-empty array of integers, return the k most frequent elements.Note:You may assume k is always valid, 1 ≤ k ≤ number of unique elements.Your algorithm’s time complexity must be better than O(n log n), where n is the array’s size.It’s原创 2020-09-07 22:04:31 · 221 阅读 · 0 评论 -
378. Kth Smallest Element in a Sorted Matrix(Leetcode每日一题-2020.07.02)
ProblemGiven a n x n matrix 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, not the kth distinct element.ExampleSolutionSoluti原创 2020-07-02 21:19:34 · 301 阅读 · 0 评论 -
215. Kth Largest Element in an Array(Leetcode每日一题-2020.06.29)
ProblemFind 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.Example1Input: [3,2,1,5,6,4] and k = 2Output: 5Example2Input: [3,2,3,1,2,4,5,5,6] and k = 4Output:原创 2020-06-29 20:08:45 · 186 阅读 · 0 评论 -
面试题40. 最小的k个数(Leetcode每日一题-2020.03.20)
Problem输入整数数组 arr ,找出其中最小的 k 个数。例如,输入4、5、1、6、2、7、3、8这8个数字,则最小的4个数字是1、2、3、4。限制:0 <= k <= arr.length <= 100000 <= arr[i] <= 10000Example1输入:arr = [3,2,1], k = 2输出:[1,2] 或者 [2,1]...原创 2020-03-20 19:27:57 · 201 阅读 · 0 评论