Design Parking System LeetCode solution in C++

1
class ParkingSystem {
2
public:
3
vector<int> vehicle;
4

5
public:
6
ParkingSystem(int big, int medium, int small) {
7
vehicle = {big, medium, small};
8
}
9

10
bool addCar(int carType) {
11
return vehicle[carType - 1]-- > 0;
12
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0