[C++/ Python] Explained || Easy Understanding ||
\nclass ParkingSystem {\npublic: vector<int> vehicle;\npublic:\n    ParkingSystem(int big, int medium, int small) {\n        vehicle = {big, medium, small};\n  
```\nclass ParkingSystem {\npublic: vector<int> vehicle;\npublic:\n    ParkingSystem(int big, int medium, int small) {\n        vehicle = {big, medium, small};\n    }\n\n    bool addCar(int carType) {\n        return vehicle[carType - 1]-- > 0;\n    }\n```\nOR\n```\nclass ParkingSystem {\npublic: vector<int> vehicle;\npublic:\n    ParkingSystem(int big, int medium, int small) {\n        vehicle = {big,medium,small};\n    }\n    bool addCar(int carType) {\n        if(vehicle[carType-1]) {\n            vehicle[carType-1]-=1\n            return true\n\t\t}\n\t\treturn false\n\t}\n};\n```\n\n***For those who didn\'t understood***\n\n**Explaination:**\n\t\t1] In the ***ParkingSystem*** constructor initialize all the elements in the **Vehicle** array / vector\n\t\t2] In ***addCar*** constructor check whether it is 1->big, 2-> medium or 3->small\n\t\t\tThen decrement the respective Vehicle array at the respective Index\n\t\t\ti.e, \n\t\t\t\tvehicle[0] =>(big)\n\t\t\t\tvehicle[1] => (medium)\n\t\t\t\tvehicle[2] => (small)\n**C++**\n```\nclass ParkingSystem {\npublic: vector<int> vehicle;\npublic:\n    ParkingSystem(int big, int medium, int small) {\n        vehicle = {big,medium,small};\n    }\n    \n    bool addCar(int carType) {\n        if(carType == 1) {\n            if(vehicle[0] > 0){\n                vehicle[0]--;\n                return true;\n            }\n        }\n        else if(carType == 2) {\n            if(vehicle[1] > 0){\n                vehicle[1]--;\n                return true;\n            }\n        }\n        else if(carType == 3) {\n            if(vehicle[2] > 0){\n                vehicle[2]--;\n                return true;\n            }\n        }\n        return false;\n    }\n};\n```\n**Python**\n```\nclass ParkingSystem:\n    def __init__(self, big: int, medium: int, small: int):\n        self.vehicle  =[big,medium,small]\n\n    def addCar(self, carType: int) -> bool:\n        if carType == 1 :\n            if self.vehicle[0] > 0:\n                self.vehicle[0]-=1\n                return True\n        elif carType == 2:\n            if self.vehicle[1] > 0:\n                self.vehicle[1]-=1\n                return True\n        elif carType == 3:\n            if self.vehicle[2] > 0:\n                self.vehicle[2]-=1\n                return True\n        return False\n```
['C', 'Python3']