JS 6 lines
\nfunction ParkingSystem(...spaces) {\n  this.spaces = spaces;\n};\nParkingSystem.prototype.addCar = function(car) {\n  return this.spaces[car-1] ? this.spaces[
```\nfunction ParkingSystem(...spaces) {\n  this.spaces = spaces;\n};\nParkingSystem.prototype.addCar = function(car) {\n  return this.spaces[car-1] ? this.spaces[car-1]-- && true : false;\n};\n```
['JavaScript']