We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8837e4 commit 378e03aCopy full SHA for 378e03a
729. My Calendar I
@@ -0,0 +1,17 @@
1
+class MyCalendar {
2
+public:
3
+ vector<pair<int, int>> booked;
4
+
5
+ MyCalendar() {
6
+ }
7
8
+ bool book(int start, int end) {
9
+ for (auto &b : booked) {
10
+ if (max(b.first, start) < min(b.second, end)) {
11
+ return false;
12
13
14
+ booked.push_back({start, end});
15
+ return true;
16
17
+};
0 commit comments