Design Parking System Problem
Design Parking System Problem — ExecCode Easy DSA Practice
Solve the Design Parking System problem on ExecCode. Free online easy DSA practice in Design. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Description You are given the input needed to solve Design Parking System. Your task is to if there is no space available, return false, else park the car in that size space and return true. Design a parking system for a parking lot. The parking lot has three kinds of parking spaces: big, medium, and small, with a fixed number of slots for each size. Implement the ParkingSystem class: - ParkingSystem(int big, int medium, int small) Initializes object of the ParkingSystem class.
Examples
Input {"data": "1 1 0\n1\n2\n3\n1"}; Output true true false false. Input {"data": "2 1 1\n1\n1\n2\n3"}; Output true true true true. Input {"data": "0 0 0\n1\n2\n3"}; Output false false false
Constraints
0 <= big, medium, small <= 1000 carType is 1, 2, or 3 At most 1000 calls will be made to addCar
Practice Design Parking System free on ExecCode. Browse DSA problems, topic map, and placement guides.