C++ Sentinel
Using a sentinel value to simplify. Also, a subtle note: doing --p in C++ is more efficent than p--. The former creates a temporary variable that holds a previo
Using a sentinel value to simplify. Also, a subtle note: doing `--p` in C++ is more efficent than `p--`. The former creates a temporary variable that holds a previous value. I am sure the compiler would optimize that anyways, but still - you can tell a pro from a rockie by which side they put their minuses (or pluses).\n\nAgain, why do we need problems like this? Are we now catering to middle-schoolers?\n\n**C++**\n```cpp\nvector<int> p;\nParkingSystem(int big, int medium, int small) : p{0, big, medium, small} {}\nbool addCar(int carType) {\n    return --p[carType] >= 0;\n}\n```
[]