Simple java solution with explaination, o(1) time, o(1) space, 99.74 % faster
we can take 3 variables to hold count of big,med,small counts. here i have taken array of size 3 instead.\n2. now just use carType-1 as index of the array and c
1. we can take 3 variables to hold count of big,med,small counts. here i have taken array of size 3 instead.\n2. now just use carType-1 as index of the array and check if value present at that index > 0. if yes return true else false. \n3. apart from that keep on decrementing value present on carType-1 index. since not more than 1000 calls cannot be made value decremented cannot go out of range.\n```\nclass ParkingSystem {\n    private int[] size;\n    public ParkingSystem(int big, int medium, int small) {\n        this.size = new int[]{big, medium, small};\n    }\n    \n    public boolean addCar(int carType) {\n        return size[carType-1]-->0;\n    }\n}\n```
['Java']