Design Parking System || very simple || efficient || one pass
Please do Upvote if it Helps !!!!!!!!!!\n\nclass ParkingSystem {\n\nprivate:\n    vector<int> carSlots= vector<int>(3,0);\npublic:\n    \n    ParkingSystem(int 
**Please do Upvote if it Helps !!!!!!!!!!**\n```\nclass ParkingSystem {\n\nprivate:\n    vector<int> carSlots= vector<int>(3,0);\npublic:\n    \n    ParkingSystem(int big, int medium, int small) {\n        \n        carSlots[0]= big ,\n        carSlots[1]= medium,\n        carSlots[2]= small;\n        \n    }\n    \n    bool addCar(int carType) {\n        \n        return carSlots[carType-1]-- <= 0 ? false : true;\n        \n    }\n};\n\n/**\n * Your ParkingSystem object will be instantiated and called as such:\n * ParkingSystem* obj = new ParkingSystem(big, medium, small);\n * bool param_1 = obj->addCar(carType);\n */\n ```\n ![image](https://assets.leetcode.com/users/images/4d9217eb-55d3-4624-9fd1-d98c1c4a2849_1654834594.334588.jpeg)\n \n **Please do Upvote if it Helps !!!!!!!!!!**\n
['Math', 'C', 'C++']