原题链接在这里:https://leetcode.com/problems/minimum-number-of-arrows-to-burst-balloons/ 题目: 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-coor...
classSolution {public:intminAreaRect(vector<vector<int>>&points) { map<int,vector<int>> m;//col -> group of row with this colfor(auto point:points){intc=point[0], r=point[1]; m[c].push_back(r); }intmin_area=INT_MAX; map<pair<int,int>,int> last_col;//(r1,r2) -> the...
The height of a rooted tree is the number of edges on the longest downward path between the root and a leaf. Example 1: Input: n = 4, edges = [[1,0],[1,2],[1,3]] Output: [1] Explanation: As shown, the height of the tree is 1 when the root is the node with label 1 ...
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. Star...