C++ solution using if, else
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \nuse of this:-\nThe this
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nuse of this:-\nThe this pointer is a pointer accessible only within the nonstatic member functions of a class , struct , or union type. It points to the object for which the member function is called\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass ParkingSystem {\npublic:\n    int big;\n    int small;\n    int medium;\n    ParkingSystem(int big, int medium, int small) {\n        this->big=big;\n        this->medium=medium;\n        this->small=small;\n    }\n    \n    bool addCar(int carType) {\n        if(carType == 1)\n        {\n            big--;\n            return big>=0;\n        }\n        else if(carType == 2)\n        {\n            medium--;\n            return medium>=0;\n        }\n        else if(carType == 3)\n        {\n             small--;\n            return small>=0;\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```
['C++']