Skip to content

Commit 3fc930c

Browse files
committed
🔧 Adding LLD Example for Parking Garage and PPT Resources
1 parent 737dfd0 commit 3fc930c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

07 LLD Interview Questions/Parking_Garage/ParkingSpot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from SpotType import SpotType
22
from Vehicle import Vehicle
33

4+
45
class ParkingSpot:
56
def __init__(self, spot_id: str, spot_type: SpotType):
67
self.spot_id = spot_id
@@ -16,4 +17,4 @@ def assign_vehicle(self, vehicle: Vehicle):
1617
self.vehicle = vehicle
1718

1819
def remove_vehicle(self):
19-
self.vehicle = None
20+
self.vehicle = None

07 LLD Interview Questions/Parking_Garage/Ticket.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import uuid
44
from datetime import datetime
55

6+
67
class Ticket:
78
def __init__(self, vehicle: Vehicle, spot: ParkingSpot):
89
self.ticket_id = str(uuid.uuid4())
@@ -17,5 +18,3 @@ def close(self):
1718
def get_fees(self):
1819
duration_minutes = (self.exit_time - self.entry_time).seconds / 60
1920
return max(10, int(duration_minutes) * 1)
20-
21-

0 commit comments

Comments
 (0)