leetcodeSolution to some Leetcode problems written in C++ |
git clone git://git.dimitrijedobrota.com/leetcode.git |
Log | Files | Refs | README | LICENSE |
1603.cpp (288B)
0 class ParkingSystem {
1 vector<int> space;
3 public:
4 ParkingSystem(int big, int medium, int small) : space(vector<int>{0, big, medium, small}) {}
6 bool addCar(int carType) {
7 if (space[carType] == 0) return false;
8 space[carType]--;
9 return true;
10 }
11 };