随笔分类 - Heap
发表于 2018-12-30 22:21阅读:329评论:0推荐:0
摘要:Starting with an undirected graph (the "original graph") with nodes from 0 to N-1, subdivisions are made to some of the edges. The graph is given as f
阅读全文 »
发表于 2018-12-30 21:13阅读:338评论:0推荐:0
摘要:A car travels from a starting position to a destination which is target miles east of the starting position. Along the way, there are gas stations. Ea
阅读全文 »
发表于 2018-12-24 22:26阅读:299评论:0推荐:0
摘要: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 gro
阅读全文 »
发表于 2018-12-22 12:10阅读:310评论:0推荐:0
摘要: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
阅读全文 »
发表于 2018-12-21 18:37阅读:325评论:0推荐:0
摘要:Given 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 h
阅读全文 »
发表于 2018-12-20 22:06阅读:361评论:0推荐:0
摘要:Suppose LeetCode will start its IPO soon. In order to sell a good price of its shares to Venture Capital, LeetCode would like to work on some projects
阅读全文 »
发表于 2018-12-20 18:20阅读:225评论:0推荐:0
摘要: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
阅读全文 »
发表于 2018-12-19 20:42阅读:241评论:0推荐:0
摘要:You 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 th
阅读全文 »
发表于 2018-12-19 17:25阅读:202评论:0推荐:0
摘要: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
阅读全文 »
发表于 2018-12-18 22:30阅读:213评论:0推荐:0
摘要: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 give
阅读全文 »