swift solution
\nclass ParkingSystem {\n    var big: Int, medium: Int, small: Int = 0\n    init(_ big: Int, _ medium: Int, _ small: Int) {\n        self.big = big\n        sel
```\nclass ParkingSystem {\n    var big: Int, medium: Int, small: Int = 0\n    init(_ big: Int, _ medium: Int, _ small: Int) {\n        self.big = big\n        self.medium = medium\n        self.small = small\n    }\n    \n    func addCar(_ carType: Int) -> Bool {\n       switch carType {\n        case 1:\n            guard big > 0 else { return false }\n            big -= 1\n           return true\n        case 2:\n            guard medium > 0 else { return false }\n            medium -= 1\n            return true\n        case 3:\n            guard small > 0 else { return false }\n            small -= 1\n            return true\n        default:\n            return false\n        }\n    }\n}\n```
[]