✅Two Java Simple Solution || ✅Runtime 7ms || ✅ Beats 99%
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# code1\n```Java\nclass ParkingSystem {\n\n    int[] arr ;\n    public ParkingSystem(int big, int medium, int small) {\n        arr = new int[]{big, medium, small};\n    }\n\n    public boolean addCar(int carType) {\n        return (arr[carType-1]-- > 0)? true : false;\n    }\n}\n\n/**\n * Your ParkingSystem object will be instantiated and called as such:\n * ParkingSystem obj = new ParkingSystem(big, medium, small);\n * boolean param_1 = obj.addCar(carType);\n */\n```\n\n\n\n# Code2\n```Java\nclass ParkingSystem {\n\n    int big , medium , small ;\n    public ParkingSystem(int big, int medium, int small) {\n        this.big = big;\n        this.medium = medium;\n        this.small = small;\n    }\n\n    public boolean addCar(int carType) {\n        boolean cond = false;\n        switch (carType){\n            case 1 : \n                cond = (this.big-- > 0) ? true : false;\n                break;\n            case 2 :\n                cond = (this.medium-- > 0) ? true : false;\n                break;\n            case 3 :\n                cond = (this.small-- > 0) ? true : false;\n                break;\n        }\n        return cond;\n    }\n}\n\n/**\n * Your ParkingSystem object will be instantiated and called as such:\n * ParkingSystem obj = new ParkingSystem(big, medium, small);\n * boolean param_1 = obj.addCar(carType);\n */\n```\n\n## For additional problem-solving solutions, you can explore my repository on GitHub: [GitHub Repository](https://github.com/ahmedna126/java_leetcode_challenges)\n\n\n\n![abcd1.jpeg](https://assets.leetcode.com/users/images/1926994d-9605-438b-9b3d-8143bdfaf5a2_1694443449.9363651.jpeg)\n
['Java']