Easy solution, [C++/Java], faster than 100.00%
Implementation\n\n1st Approach in C++\n\n\nclass ParkingSystem {\npublic:\n    vector<int> parking;\n    ParkingSystem(int big, int medium, int small) {\n      
**Implementation**\n\n**1st Approach in C++**\n\n```\nclass ParkingSystem {\npublic:\n    vector<int> parking;\n    ParkingSystem(int big, int medium, int small) {\n        parking = {big, medium, small};\n    }\n    \n    bool addCar(int carType) {\n        if(parking[carType-1]){\n          parking[carType-1] = parking[carType-1] - 1;\n            return true;  \n        } \n        else return false;\n    }\n};\n```\n**2nd Approach in Java**\n```\nclass ParkingSystem {\n    int[] parking;\n    public ParkingSystem(int big, int medium, int small) {\n        parking = new int[]{big, medium, small};\n    }\n    \n    public boolean addCar(int carType) {\n        if(parking[carType-1] != 0){\n          parking[carType-1] = parking[carType-1] - 1;\n            return true;  \n        } \n        else return false;\n    }\n}\n```\nIf you find any issue in understanding the solutions then comment below, will try to help you.\nIf you found my solution useful.\nSo **please do upvote and encourage me** to document all leetcode problems\uD83D\uDE03\nHappy Coding :)
['Array', 'Design', 'C', 'Java']