Python Easy and Efficient Solution with Dictionary
All of the parking space types and capacities are in one place. Adding a new type of vehicle parking can be done by appending new key:value pair entry to dictio
All of the parking space types and capacities are in one place. Adding a new type of vehicle parking can be done by appending new key:value pair entry to dictionary. \n\'\'\'\n\n    def __init__(self, big: int, medium: int, small: int):\n        self.dictCap = {\n            1 : big, \n            2 : medium,\n            3 : small\n        }\n        \n    def addCar(self, carType: int) -> bool:\n        # checks wether there is a parkign space of carType \n        # if there is no space return false, else park the car and return truee\n        \n        if self.dictCap[carType]>0:\n            self.dictCap[carType] = self.dictCap[carType]-1\n            return True\n        return False\n\'\'\'
[]