> For the complete documentation index, see [llms.txt](https://longxingtan.gitbook.io/mle-interview/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://longxingtan.gitbook.io/mle-interview/01_leetcode/17_design/1603.-design-parking-system.md).

# 1603. Design Parking System

<https://leetcode.com/problems/design-parking-system/description/>

## solution

```python
class ParkingSystem:
    def __init__(self, big: int, medium: int, small: int):
        self.count = [big, medium, small]

    def addCar(self, carType: int) -> bool:
        self.count[carType - 1] -= 1
        return self.count[carType - 1] >= 0
```

时间复杂度：O(1)\
空间复杂度：O(1)
