#include <leetcode.h>
|
int | big |
| The number of slots for big parking space 更多...
|
|
int | medium |
| The number of slots for medium parking space 更多...
|
|
int | small |
| The number of slots for small parking space 更多...
|
|
◆ ParkingSystem()
leetcode::design_parking_system::ParkingSystem::ParkingSystem |
( |
int |
big, |
|
|
int |
medium, |
|
|
int |
small |
|
) |
| |
Initializes object of the ParkingSystem class.
- 参数
-
big | The number of slots for big parking space |
medium | The number of slots for medium parking space |
small | The number of slots for small parking space |
在文件 leetcode.cpp 第 6023 行定义.
int medium
The number of slots for medium parking space
int big
The number of slots for big parking space
int small
The number of slots for small parking space
◆ addCar()
bool leetcode::design_parking_system::ParkingSystem::addCar |
( |
int |
carType | ) |
|
Checks whether there is a parking space of carType for the car that wants to get into the parking lot.
- 参数
-
carType | carType can be of three kinds: big, medium, or small, which are represented by 1, 2, and 3 respectively. A car can only park in a parking space of its carType. |
- 返回
- If there is no space available, return false, else park the car in that size space and return true.
在文件 leetcode.cpp 第 6026 行定义.
6049 default:
return false;
引用了 big, medium , 以及 small.
◆ big
int leetcode::design_parking_system::ParkingSystem::big |
|
private |
◆ medium
int leetcode::design_parking_system::ParkingSystem::medium |
|
private |
◆ small
int leetcode::design_parking_system::ParkingSystem::small |
|
private |
该类的文档由以下文件生成: