diff --git a/LeetCode/1603_Design_Parking_System.py b/LeetCode/1603_Design_Parking_System.py new file mode 100644 index 0000000..cbba789 --- /dev/null +++ b/LeetCode/1603_Design_Parking_System.py @@ -0,0 +1,11 @@ +class ParkingSystem: + + def __init__(self, big: int, medium: int, small: int): + self._limits = [big, medium, small] + + + def addCar(self, carType: int) -> bool: + self._limits[carType - 1] -= 1 + if self._limits[carType - 1] < 0: + return False + return True