Skip to content

Commit 76d92fe

Browse files
committed
Runtime: 730 ms (Top 38.78%) | Memory: 147.5 MB (Top 81.13%)
1 parent e37e31e commit 76d92fe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1+
// Runtime: 730 ms (Top 38.78%) | Memory: 147.5 MB (Top 81.13%)
12
class SeatManager {
23
public:
34
priority_queue<int, vector<int>, greater<int> > pq;
45
SeatManager(int n) {
56
for(int i = 1; i <= n; i++) pq.push(i);
67
}
7-
8+
89
int reserve() {
910
int top = pq.top(); pq.pop();
1011
return top;
1112
}
12-
13+
1314
void unreserve(int seatNumber) {
1415
pq.push(seatNumber);
1516
}
16-
};
17+
};

0 commit comments

Comments
 (0)