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 8258a74 commit 733e40fCopy full SHA for 733e40f
scripts/algorithms/M/My Calendar I/My Calendar I.cpp
@@ -1,16 +1,17 @@
1
+// Runtime: 195 ms (Top 40.35%) | Memory: 37.6 MB (Top 80.95%)
2
class MyCalendar {
3
public:
- vector<pair<int,int>>cal;
4
- MyCalendar() {
+ vector<pair<int,int>>cal;
5
+ MyCalendar() {
6
- }
7
+ }
8
- bool book(int start, int end) {
9
- for(int i=0;i<cal.size();i++){
10
- if(end<=cal[i].first || start>=cal[i].second)continue;
11
- else return false;
12
13
- cal.push_back({start,end});
14
- return true;
15
+ bool book(int start, int end) {
+ for(int i=0;i<cal.size();i++){
+ if(end<=cal[i].first || start>=cal[i].second)continue;
+ else return false;
+ cal.push_back({start,end});
+ return true;
16
17
};
0 commit comments