128ms, Python (with comments)
If you find this post helpful, please Upvote :)\n\nclass ParkingSystem(object):\n\n    def __init__(self, big, medium, small):\n        #We store the parking sp
If you find this post helpful, please **Upvote** :)\n```\nclass ParkingSystem(object):\n\n    def __init__(self, big, medium, small):\n        #We store the parking space available for each car category in the respective variable\n        self.big = big\n        self.medium = medium \n        self.small = small\n\n    def addCar(self, carType):\n        #checking if the incoming car is big and if parking space is available for big cars\n        if carType == 1 and self.big > 0:\n            self.big -=1\n            return True\n        #checking if the incoming car is medium and if parking space is available for medium cars\n        elif carType == 2 and self.medium > 0:\n            self.medium -=1\n            return True \n        #checking if the incoming car is small and if parking space is available for small cars\n        elif carType == 3 and self.small > 0:\n            self.small -=1\n            return True\n        #If the car isnt either small,medium,big or if the parking space isnt available then we return false\n        else:\n            return False\n\n\n# Your ParkingSystem object will be instantiated and called as such:\n# obj = ParkingSystem(big, medium, small)\n# param_1 = obj.addCar(carType)\n```\n![image](https://assets.leetcode.com/users/images/a6fe4d27-2e8f-49db-b69e-03e289da4d2f_1617889069.4021397.png)\nPlease comment if you have any doubts or suggestions :)
['Python', 'Python3']