1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>请你给一个停车场设计一个停车系统。停车场总共有三种不同大小的车位:大,中和小,每种尺寸分别有固定数目的车位。</p>\n\n<p>请你实现 <code>ParkingSystem</code> 类:</p>\n\n<ul>\n\t<li><code>ParkingSystem(int big, int medium, int small)</code> 初始化 <code>ParkingSystem</code> 类,三个参数分别对应每种停车位的数目。</li>\n\t<li><code>bool addCar(int carType)</code> 检查是否有 <code>carType</code> 对应的停车位。 <code>carType</code> 有三种类型:大,中,小,分别用数字 <code>1</code> <code>2</code> 和 <code>3</code> 表示。<strong>一辆车只能停在</strong> <strong> </strong><code>carType</code> 对应尺寸的停车位中。如果没有空车位,请返回 <code>false</code> ,否则将该车停入车位并返回 <code>true</code> 。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>\n[\"ParkingSystem\", \"addCar\", \"addCar\", \"addCar\", \"addCar\"]\n[[1, 1, 0], [1], [2], [3], [1]]\n<strong>输出:</strong>\n[null, true, true, false, false]\n\n<strong>解释:</strong>\nParkingSystem parkingSystem = new ParkingSystem(1, 1, 0);\nparkingSystem.addCar(1); // 返回 true ,因为有 1 个空的大车位\nparkingSystem.addCar(2); // 返回 true ,因为有 1 个空的中车位\nparkingSystem.addCar(3); // 返回 false ,因为没有空的小车位\nparkingSystem.addCar(1); // 返回 false ,因为没有空的大车位,唯一一个大车位已经被占据了\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= big, medium, small <= 1000</code></li>\n\t<li><code>carType</code> 取值为 <code>1</code> <code>2</code> 或 <code>3</code></li>\n\t<li>最多会调用 <code>addCar</code> 函数 <code>1000</code> 次</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 108,
"likes": 110,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"62.2K\", \"totalSubmission\": \"73.6K\", \"totalAcceptedRaw\": 62232, \"totalSubmissionRaw\": 73639, \"acRate\": \"84.5%\"}",
"stats": "{\"totalAccepted\": \"63.6K\", \"totalSubmission\": \"75.2K\", \"totalAcceptedRaw\": 63565, \"totalSubmissionRaw\": 75243, \"acRate\": \"84.5%\"}",
"hints": [
"Record number of parking slots still available for each car type."
],