Very Easy Map Approach || C++
Intuition\nInitialize the available car spaces in the map \nthen just check if that space is greater than zero \nif it is then -1 the car space and return true\
# Intuition\nInitialize the available car spaces in the map \nthen just check if that space is greater than zero \nif it is then -1 the car space and return true\nelse return false \n\n\n# Code\n```\nclass ParkingSystem {\npublic:\n    map<int,int> m;\n    ParkingSystem(int big, int medium, int small) {\n        //setting the spaces for every type of car\n        m[0]=big;\n        m[1]=medium;\n        m[2]=small;\n    }\n    \n    bool addCar(int carType) {\n        //as we started 0 based index we -1 the carType value\n        if(m[carType-1]>0){\n            m[carType-1]--;\n            return true;\n        }\n        return false;            \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```
['Design', 'Simulation', 'Counting', 'C++']