LLD - Design — Parking Lot System
Given the enum
SpotType { COMPACT, LARGE, HANDICAPPED } and a function that assigns spots based on vehicle type, what will be the output of this code snippet?VehicleType vehicle = VehicleType.CAR;
SpotType spot;
switch(vehicle) {
case VehicleType.CAR:
spot = SpotType.COMPACT;
break;
case VehicleType.BIKE:
spot = SpotType.HANDICAPPED;
break;
default:
spot = SpotType.LARGE;
}
print(spot);