python 3 - simple iteration
Complexity\n- Time complexity:\n__init__ : O(1)\naddCar: O(1)\n\n- Space complexity:\n__init__ : O(1)\naddCar: O(1)\n\n# Code\n\nclass ParkingSystem:\n\n    def
# Complexity\n- Time complexity:\n__init__ : O(1)\naddCar: O(1)\n\n- Space complexity:\n__init__ : O(1)\naddCar: O(1)\n\n# Code\n```\nclass ParkingSystem:\n\n    def __init__(self, big: int, medium: int, small: int):\n        self.space = [0, big, medium, small]\n        \n    def addCar(self, carType: int) -> bool:\n        if self.space[carType] > 0:\n            self.space[carType] -= 1\n            return True\n        return False\n\n        \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```
['Python3']