贪心
刷题
252. 会议室(P)
253. 会议室 II (P)
#define MAX 1000001
int minMeetingRooms(int** intervals, int intervalsSize, int* intervalsColSize) {
int diff[MAX] = {0};
for (int i = 0; i < intervalsSize; i++) {
diff[intervals[i][0]] += 1;
diff[intervals[i][1]] -= 1;
}
int ret = 0;
long sum = 0;
for (int i = 0; i < MAX; i++) {
sum += diff[i];
ret = fmax(sum, ret);
}
return ret;
}
https://leetcode.cn/problems/meeting-rooms-ii/solutions/2081316/labuladong-sao-miao-xian-ji-qiao-an-pai-h0f5d/
https://leetcode.cn/problems/meeting-rooms-ii/solutions/950111/253hui-yi-shi-ii-pai-xu-bian-li-by-agven-49qp/
1353. 最多可以参加的会议数目