classParkingSystem { public: int repo[4]={0}; ParkingSystem(int big, int medium, int small) { repo[1]=big; repo[2]=medium; repo[3]=small; } booladdCar(int carType){ if(repo[carType]>0) { repo[carType]--; returntrue; } returnfalse; } };
/** * Your ParkingSystem object will be instantiated and called as such: * ParkingSystem* obj = new ParkingSystem(big, medium, small); * bool param_1 = obj->addCar(carType); */