Java Simple HashMap
One hashMap solves everything.\n\nclass ParkingSystem {\n    Map<Integer, Integer> map = new HashMap<>();\n\n    public ParkingSystem(int big, int medium, int s
One hashMap solves everything.\n```\nclass ParkingSystem {\n    Map<Integer, Integer> map = new HashMap<>();\n\n    public ParkingSystem(int big, int medium, int small) {\n        map.put(1, big);  // load quotas.\n        map.put(2, medium);\n        map.put(3, small);\n    }\n    \n    public boolean addCar(int carType) {\n        map.put(carType, map.get(carType) - 1);  // consume quota\n        if (map.get(carType) < 0) return false;  // check if quota enough..\n        return true;\n    }\n}\n```
[]