leetcode502. IPO

2020-01-09
阅读 4 分钟
2.1k
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 to increase its capital before the IPO. Since it has limited resources, it can only finish at most k distinct projects before the IPO. Help LeetCo...

leetcode452. Minimum Number of Arrows to Burst Balloons

2019-11-08
阅读 2 分钟
1.5k
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, y-coordinates don't matter and hence the x-coordinates of start and end of the diameter suffice. Start is ...

leetcode421. Maximum XOR of Two Numbers in an Array

2019-11-06
阅读 5 分钟
1.6k
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai< 231.

leetcode435. Non-overlapping Intervals

2019-09-30
阅读 2 分钟
1.7k
使用二维数组表示区间组,每一个子数组的第一个值表示区间的开始坐标,第二个值表示区间的结束坐标。计算最少进行多少次删除操作,可以确保剩下的区间不会产生任何重叠。

leetcode135. Candy

2018-02-28
阅读 2 分钟
2.2k
题目要求 {代码...} 假设有N个孩子站成一排,每个孩子拥有一个评估值。现在要根据以下的需求给孩子们分发糖果: 每个孩子至少有一颗糖 有更高评估值的孩子应当比两侧孩子得到的糖更多 问最少要发出多少颗糖? 思路和代码 这里我们可以举一个例子来先试着分配一下:假设有10个孩子,每个孩子对应的评估分别是[3,4,5,7,2,3...