mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
195 lines
43 KiB
JSON
195 lines
43 KiB
JSON
{
|
||
"data": {
|
||
"question": {
|
||
"questionId": "2023",
|
||
"questionFrontendId": "1912",
|
||
"categoryTitle": "Algorithms",
|
||
"boundTopicId": 842261,
|
||
"title": "Design Movie Rental System",
|
||
"titleSlug": "design-movie-rental-system",
|
||
"content": "<p>You have a movie renting company consisting of <code>n</code> shops. You want to implement a renting system that supports searching for, booking, and returning movies. The system should also support generating a report of the currently rented movies.</p>\n\n<p>Each movie is given as a 2D integer array <code>entries</code> where <code>entries[i] = [shop<sub>i</sub>, movie<sub>i</sub>, price<sub>i</sub>]</code> indicates that there is a copy of movie <code>movie<sub>i</sub></code> at shop <code>shop<sub>i</sub></code> with a rental price of <code>price<sub>i</sub></code>. Each shop carries <strong>at most one</strong> copy of a movie <code>movie<sub>i</sub></code>.</p>\n\n<p>The system should support the following functions:</p>\n\n<ul>\n\t<li><strong>Search</strong>: Finds the <strong>cheapest 5 shops</strong> that have an <strong>unrented copy</strong> of a given movie. The shops should be sorted by <strong>price</strong> in ascending order, and in case of a tie, the one with the <strong>smaller </strong><code>shop<sub>i</sub></code> should appear first. If there are less than 5 matching shops, then all of them should be returned. If no shop has an unrented copy, then an empty list should be returned.</li>\n\t<li><strong>Rent</strong>: Rents an <strong>unrented copy</strong> of a given movie from a given shop.</li>\n\t<li><strong>Drop</strong>: Drops off a <strong>previously rented copy</strong> of a given movie at a given shop.</li>\n\t<li><strong>Report</strong>: Returns the <strong>cheapest 5 rented movies</strong> (possibly of the same movie ID) as a 2D list <code>res</code> where <code>res[j] = [shop<sub>j</sub>, movie<sub>j</sub>]</code> describes that the <code>j<sup>th</sup></code> cheapest rented movie <code>movie<sub>j</sub></code> was rented from the shop <code>shop<sub>j</sub></code>. The movies in <code>res</code> should be sorted by <strong>price </strong>in ascending order, and in case of a tie, the one with the <strong>smaller </strong><code>shop<sub>j</sub></code> should appear first, and if there is still tie, the one with the <strong>smaller </strong><code>movie<sub>j</sub></code> should appear first. If there are fewer than 5 rented movies, then all of them should be returned. If no movies are currently being rented, then an empty list should be returned.</li>\n</ul>\n\n<p>Implement the <code>MovieRentingSystem</code> class:</p>\n\n<ul>\n\t<li><code>MovieRentingSystem(int n, int[][] entries)</code> Initializes the <code>MovieRentingSystem</code> object with <code>n</code> shops and the movies in <code>entries</code>.</li>\n\t<li><code>List<Integer> search(int movie)</code> Returns a list of shops that have an <strong>unrented copy</strong> of the given <code>movie</code> as described above.</li>\n\t<li><code>void rent(int shop, int movie)</code> Rents the given <code>movie</code> from the given <code>shop</code>.</li>\n\t<li><code>void drop(int shop, int movie)</code> Drops off a previously rented <code>movie</code> at the given <code>shop</code>.</li>\n\t<li><code>List<List<Integer>> report()</code> Returns a list of cheapest <strong>rented</strong> movies as described above.</li>\n</ul>\n\n<p><strong>Note:</strong> The test cases will be generated such that <code>rent</code> will only be called if the shop has an <strong>unrented</strong> copy of the movie, and <code>drop</code> will only be called if the shop had <strong>previously rented</strong> out the movie.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input</strong>\n["MovieRentingSystem", "search", "rent", "rent", "report", "drop", "search"]\n[[3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]], [1], [0, 1], [1, 2], [], [1, 2], [2]]\n<strong>Output</strong>\n[null, [1, 0, 2], null, null, [[0, 1], [1, 2]], null, [0, 1]]\n\n<strong>Explanation</strong>\nMovieRentingSystem movieRentingSystem = new MovieRentingSystem(3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]);\nmovieRentingSystem.search(1); // return [1, 0, 2], Movies of ID 1 are unrented at shops 1, 0, and 2. Shop 1 is cheapest; shop 0 and 2 are the same price, so order by shop number.\nmovieRentingSystem.rent(0, 1); // Rent movie 1 from shop 0. Unrented movies at shop 0 are now [2,3].\nmovieRentingSystem.rent(1, 2); // Rent movie 2 from shop 1. Unrented movies at shop 1 are now [1].\nmovieRentingSystem.report(); // return [[0, 1], [1, 2]]. Movie 1 from shop 0 is cheapest, followed by movie 2 from shop 1.\nmovieRentingSystem.drop(1, 2); // Drop off movie 2 at shop 1. Unrented movies at shop 1 are now [1,2].\nmovieRentingSystem.search(2); // return [0, 1]. Movies of ID 2 are unrented at shops 0 and 1. Shop 0 is cheapest, followed by shop 1.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 3 * 10<sup>5</sup></code></li>\n\t<li><code>1 <= entries.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= shop<sub>i</sub> < n</code></li>\n\t<li><code>1 <= movie<sub>i</sub>, price<sub>i</sub> <= 10<sup>4</sup></code></li>\n\t<li>Each shop carries <strong>at most one</strong> copy of a movie <code>movie<sub>i</sub></code>.</li>\n\t<li>At most <code>10<sup>5</sup></code> calls <strong>in total</strong> will be made to <code>search</code>, <code>rent</code>, <code>drop</code> and <code>report</code>.</li>\n</ul>\n",
|
||
"translatedTitle": "设计电影租借系统",
|
||
"translatedContent": "<p>你有一个电影租借公司和 <code>n</code> 个电影商店。你想要实现一个电影租借系统,它支持查询、预订和返还电影的操作。同时系统还能生成一份当前被借出电影的报告。</p>\n\n<p>所有电影用二维整数数组 <code>entries</code> 表示,其中 <code>entries[i] = [shop<sub>i</sub>, movie<sub>i</sub>, price<sub>i</sub>]</code> 表示商店 <code>shop<sub>i</sub></code> 有一份电影 <code>movie<sub>i</sub></code> 的拷贝,租借价格为 <code>price<sub>i</sub></code> 。每个商店有 <strong>至多一份</strong> 编号为 <code>movie<sub>i</sub></code> 的电影拷贝。</p>\n\n<p>系统需要支持以下操作:</p>\n\n<ul>\n\t<li><strong>Search:</strong>找到拥有指定电影且 <strong>未借出</strong> 的商店中 <strong>最便宜的 5 个</strong> 。商店需要按照 <strong>价格</strong> 升序排序,如果价格相同,则 <code>shop<sub>i</sub></code> <strong>较小</strong> 的商店排在前面。如果查询结果少于 5 个商店,则将它们全部返回。如果查询结果没有任何商店,则返回空列表。</li>\n\t<li><strong>Rent:</strong>从指定商店借出指定电影,题目保证指定电影在指定商店 <strong>未借出</strong> 。</li>\n\t<li><strong>Drop:</strong>在指定商店返还 <strong>之前已借出</strong> 的指定电影。</li>\n\t<li><strong>Report:</strong>返回 <strong>最便宜的 5 部已借出电影</strong> (可能有重复的电影 ID),将结果用二维列表 <code>res</code> 返回,其中 <code>res[j] = [shop<sub>j</sub>, movie<sub>j</sub>]</code> 表示第 <code>j</code> 便宜的已借出电影是从商店 <code>shop<sub>j</sub></code> 借出的电影 <code>movie<sub>j</sub></code> 。<code>res</code> 中的电影需要按 <strong>价格</strong> 升序排序;如果价格相同,则<strong> </strong><code>shop<sub>j</sub></code> <strong>较小</strong> 的排在前面;如果仍然相同,则 <code>movie<sub>j</sub></code> <strong>较小 </strong>的排在前面。如果当前借出的电影小于 5 部,则将它们全部返回。如果当前没有借出电影,则返回一个空的列表。</li>\n</ul>\n\n<p>请你实现 <code>MovieRentingSystem</code> 类:</p>\n\n<ul>\n\t<li><code>MovieRentingSystem(int n, int[][] entries)</code> 将 <code>MovieRentingSystem</code> 对象用 <code>n</code> 个商店和 <code>entries</code> 表示的电影列表初始化。</li>\n\t<li><code>List<Integer> search(int movie)</code> 如上所述,返回 <strong>未借出</strong> 指定 <code>movie</code> 的商店列表。</li>\n\t<li><code>void rent(int shop, int movie)</code> 从指定商店 <code>shop</code> 借出指定电影 <code>movie</code> 。</li>\n\t<li><code>void drop(int shop, int movie)</code> 在指定商店 <code>shop</code> 返还之前借出的电影 <code>movie</code> 。</li>\n\t<li><code>List<List<Integer>> report()</code> 如上所述,返回最便宜的 <strong>已借出</strong> 电影列表。</li>\n</ul>\n\n<p><strong>注意:</strong>测试数据保证 <code>rent</code> 操作中指定商店拥有 <strong>未借出 </strong>的指定电影,且 <code>drop</code> 操作指定的商店 <strong>之前已借出</strong> 指定电影。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>\n[\"MovieRentingSystem\", \"search\", \"rent\", \"rent\", \"report\", \"drop\", \"search\"]\n[[3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]], [1], [0, 1], [1, 2], [], [1, 2], [2]]\n<strong>输出:</strong>\n[null, [1, 0, 2], null, null, [[0, 1], [1, 2]], null, [0, 1]]\n\n<strong>解释:</strong>\nMovieRentingSystem movieRentingSystem = new MovieRentingSystem(3, [[0, 1, 5], [0, 2, 6], [0, 3, 7], [1, 1, 4], [1, 2, 7], [2, 1, 5]]);\nmovieRentingSystem.search(1); // 返回 [1, 0, 2] ,商店 1,0 和 2 有未借出的 ID 为 1 的电影。商店 1 最便宜,商店 0 和 2 价格相同,所以按商店编号排序。\nmovieRentingSystem.rent(0, 1); // 从商店 0 借出电影 1 。现在商店 0 未借出电影编号为 [2,3] 。\nmovieRentingSystem.rent(1, 2); // 从商店 1 借出电影 2 。现在商店 1 未借出的电影编号为 [1] 。\nmovieRentingSystem.report(); // 返回 [[0, 1], [1, 2]] 。商店 0 借出的电影 1 最便宜,然后是商店 1 借出的电影 2 。\nmovieRentingSystem.drop(1, 2); // 在商店 1 返还电影 2 。现在商店 1 未借出的电影编号为 [1,2] 。\nmovieRentingSystem.search(2); // 返回 [0, 1] 。商店 0 和 1 有未借出的 ID 为 2 的电影。商店 0 最便宜,然后是商店 1 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 3 * 10<sup>5</sup></code></li>\n\t<li><code>1 <= entries.length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= shop<sub>i</sub> < n</code></li>\n\t<li><code>1 <= movie<sub>i</sub>, price<sub>i</sub> <= 10<sup>4</sup></code></li>\n\t<li>每个商店 <strong>至多</strong> 有一份电影 <code>movie<sub>i</sub></code> 的拷贝。</li>\n\t<li><code>search</code>,<code>rent</code>,<code>drop</code> 和 <code>report</code> 的调用 <strong>总共</strong> 不超过 <code>10<sup>5</sup></code> 次。</li>\n</ul>\n",
|
||
"isPaidOnly": false,
|
||
"difficulty": "Hard",
|
||
"likes": 53,
|
||
"dislikes": 0,
|
||
"isLiked": null,
|
||
"similarQuestions": "[]",
|
||
"contributors": [],
|
||
"langToValidPlayground": "{\"cpp\": false, \"java\": false, \"python\": false, \"python3\": false, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"typescript\": false, \"bash\": false, \"php\": false, \"swift\": false, \"kotlin\": false, \"dart\": false, \"golang\": false, \"ruby\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"rust\": false, \"racket\": false, \"erlang\": false, \"elixir\": false, \"pythondata\": false, \"react\": false, \"vanillajs\": false, \"postgresql\": false}",
|
||
"topicTags": [
|
||
{
|
||
"name": "Design",
|
||
"slug": "design",
|
||
"translatedName": "设计",
|
||
"__typename": "TopicTagNode"
|
||
},
|
||
{
|
||
"name": "Array",
|
||
"slug": "array",
|
||
"translatedName": "数组",
|
||
"__typename": "TopicTagNode"
|
||
},
|
||
{
|
||
"name": "Hash Table",
|
||
"slug": "hash-table",
|
||
"translatedName": "哈希表",
|
||
"__typename": "TopicTagNode"
|
||
},
|
||
{
|
||
"name": "Ordered Set",
|
||
"slug": "ordered-set",
|
||
"translatedName": "有序集合",
|
||
"__typename": "TopicTagNode"
|
||
},
|
||
{
|
||
"name": "Heap (Priority Queue)",
|
||
"slug": "heap-priority-queue",
|
||
"translatedName": "堆(优先队列)",
|
||
"__typename": "TopicTagNode"
|
||
}
|
||
],
|
||
"companyTagStats": null,
|
||
"codeSnippets": [
|
||
{
|
||
"lang": "C++",
|
||
"langSlug": "cpp",
|
||
"code": "class MovieRentingSystem {\npublic:\n MovieRentingSystem(int n, vector<vector<int>>& entries) {\n\n }\n \n vector<int> search(int movie) {\n\n }\n \n void rent(int shop, int movie) {\n\n }\n \n void drop(int shop, int movie) {\n\n }\n \n vector<vector<int>> report() {\n\n }\n};\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * MovieRentingSystem* obj = new MovieRentingSystem(n, entries);\n * vector<int> param_1 = obj->search(movie);\n * obj->rent(shop,movie);\n * obj->drop(shop,movie);\n * vector<vector<int>> param_4 = obj->report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Java",
|
||
"langSlug": "java",
|
||
"code": "class MovieRentingSystem {\n\n public MovieRentingSystem(int n, int[][] entries) {\n\n }\n \n public List<Integer> search(int movie) {\n\n }\n \n public void rent(int shop, int movie) {\n\n }\n \n public void drop(int shop, int movie) {\n\n }\n \n public List<List<Integer>> report() {\n\n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * MovieRentingSystem obj = new MovieRentingSystem(n, entries);\n * List<Integer> param_1 = obj.search(movie);\n * obj.rent(shop,movie);\n * obj.drop(shop,movie);\n * List<List<Integer>> param_4 = obj.report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Python",
|
||
"langSlug": "python",
|
||
"code": "class MovieRentingSystem(object):\n\n def __init__(self, n, entries):\n \"\"\"\n :type n: int\n :type entries: List[List[int]]\n \"\"\"\n\n\n def search(self, movie):\n \"\"\"\n :type movie: int\n :rtype: List[int]\n \"\"\"\n\n\n def rent(self, shop, movie):\n \"\"\"\n :type shop: int\n :type movie: int\n :rtype: None\n \"\"\"\n\n\n def drop(self, shop, movie):\n \"\"\"\n :type shop: int\n :type movie: int\n :rtype: None\n \"\"\"\n\n\n def report(self):\n \"\"\"\n :rtype: List[List[int]]\n \"\"\"\n\n\n\n# Your MovieRentingSystem object will be instantiated and called as such:\n# obj = MovieRentingSystem(n, entries)\n# param_1 = obj.search(movie)\n# obj.rent(shop,movie)\n# obj.drop(shop,movie)\n# param_4 = obj.report()",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Python3",
|
||
"langSlug": "python3",
|
||
"code": "class MovieRentingSystem:\n\n def __init__(self, n: int, entries: List[List[int]]):\n\n\n def search(self, movie: int) -> List[int]:\n\n\n def rent(self, shop: int, movie: int) -> None:\n\n\n def drop(self, shop: int, movie: int) -> None:\n\n\n def report(self) -> List[List[int]]:\n\n\n\n# Your MovieRentingSystem object will be instantiated and called as such:\n# obj = MovieRentingSystem(n, entries)\n# param_1 = obj.search(movie)\n# obj.rent(shop,movie)\n# obj.drop(shop,movie)\n# param_4 = obj.report()",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "C",
|
||
"langSlug": "c",
|
||
"code": "\n\n\ntypedef struct {\n \n} MovieRentingSystem;\n\n\nMovieRentingSystem* movieRentingSystemCreate(int n, int** entries, int entriesSize, int* entriesColSize) {\n \n}\n\nint* movieRentingSystemSearch(MovieRentingSystem* obj, int movie, int* retSize) {\n \n}\n\nvoid movieRentingSystemRent(MovieRentingSystem* obj, int shop, int movie) {\n \n}\n\nvoid movieRentingSystemDrop(MovieRentingSystem* obj, int shop, int movie) {\n \n}\n\nint** movieRentingSystemReport(MovieRentingSystem* obj, int* retSize, int** retColSize) {\n \n}\n\nvoid movieRentingSystemFree(MovieRentingSystem* obj) {\n \n}\n\n/**\n * Your MovieRentingSystem struct will be instantiated and called as such:\n * MovieRentingSystem* obj = movieRentingSystemCreate(n, entries, entriesSize, entriesColSize);\n * int* param_1 = movieRentingSystemSearch(obj, movie, retSize);\n \n * movieRentingSystemRent(obj, shop, movie);\n \n * movieRentingSystemDrop(obj, shop, movie);\n \n * int** param_4 = movieRentingSystemReport(obj, retSize, retColSize);\n \n * movieRentingSystemFree(obj);\n*/",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "C#",
|
||
"langSlug": "csharp",
|
||
"code": "public class MovieRentingSystem {\n\n public MovieRentingSystem(int n, int[][] entries) {\n\n }\n \n public IList<int> Search(int movie) {\n\n }\n \n public void Rent(int shop, int movie) {\n\n }\n \n public void Drop(int shop, int movie) {\n\n }\n \n public IList<IList<int>> Report() {\n\n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * MovieRentingSystem obj = new MovieRentingSystem(n, entries);\n * IList<int> param_1 = obj.Search(movie);\n * obj.Rent(shop,movie);\n * obj.Drop(shop,movie);\n * IList<IList<int>> param_4 = obj.Report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "JavaScript",
|
||
"langSlug": "javascript",
|
||
"code": "/**\n * @param {number} n\n * @param {number[][]} entries\n */\nvar MovieRentingSystem = function(n, entries) {\n\n};\n\n/** \n * @param {number} movie\n * @return {number[]}\n */\nMovieRentingSystem.prototype.search = function(movie) {\n\n};\n\n/** \n * @param {number} shop \n * @param {number} movie\n * @return {void}\n */\nMovieRentingSystem.prototype.rent = function(shop, movie) {\n\n};\n\n/** \n * @param {number} shop \n * @param {number} movie\n * @return {void}\n */\nMovieRentingSystem.prototype.drop = function(shop, movie) {\n\n};\n\n/**\n * @return {number[][]}\n */\nMovieRentingSystem.prototype.report = function() {\n\n};\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * var obj = new MovieRentingSystem(n, entries)\n * var param_1 = obj.search(movie)\n * obj.rent(shop,movie)\n * obj.drop(shop,movie)\n * var param_4 = obj.report()\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "TypeScript",
|
||
"langSlug": "typescript",
|
||
"code": "class MovieRentingSystem {\n constructor(n: number, entries: number[][]) {\n \n }\n\n search(movie: number): number[] {\n \n }\n\n rent(shop: number, movie: number): void {\n \n }\n\n drop(shop: number, movie: number): void {\n \n }\n\n report(): number[][] {\n \n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * var obj = new MovieRentingSystem(n, entries)\n * var param_1 = obj.search(movie)\n * obj.rent(shop,movie)\n * obj.drop(shop,movie)\n * var param_4 = obj.report()\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "PHP",
|
||
"langSlug": "php",
|
||
"code": "class MovieRentingSystem {\n /**\n * @param Integer $n\n * @param Integer[][] $entries\n */\n function __construct($n, $entries) {\n\n }\n\n /**\n * @param Integer $movie\n * @return Integer[]\n */\n function search($movie) {\n\n }\n\n /**\n * @param Integer $shop\n * @param Integer $movie\n * @return NULL\n */\n function rent($shop, $movie) {\n\n }\n\n /**\n * @param Integer $shop\n * @param Integer $movie\n * @return NULL\n */\n function drop($shop, $movie) {\n\n }\n\n /**\n * @return Integer[][]\n */\n function report() {\n\n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * $obj = MovieRentingSystem($n, $entries);\n * $ret_1 = $obj->search($movie);\n * $obj->rent($shop, $movie);\n * $obj->drop($shop, $movie);\n * $ret_4 = $obj->report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Swift",
|
||
"langSlug": "swift",
|
||
"code": "\nclass MovieRentingSystem {\n\n init(_ n: Int, _ entries: [[Int]]) {\n\n }\n \n func search(_ movie: Int) -> [Int] {\n\n }\n \n func rent(_ shop: Int, _ movie: Int) {\n\n }\n \n func drop(_ shop: Int, _ movie: Int) {\n\n }\n \n func report() -> [[Int]] {\n\n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * let obj = MovieRentingSystem(n, entries)\n * let ret_1: [Int] = obj.search(movie)\n * obj.rent(shop, movie)\n * obj.drop(shop, movie)\n * let ret_4: [[Int]] = obj.report()\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Kotlin",
|
||
"langSlug": "kotlin",
|
||
"code": "class MovieRentingSystem(n: Int, entries: Array<IntArray>) {\n\n fun search(movie: Int): List<Int> {\n\n }\n\n fun rent(shop: Int, movie: Int) {\n\n }\n\n fun drop(shop: Int, movie: Int) {\n\n }\n\n fun report(): List<List<Int>> {\n\n }\n\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * var obj = MovieRentingSystem(n, entries)\n * var param_1 = obj.search(movie)\n * obj.rent(shop,movie)\n * obj.drop(shop,movie)\n * var param_4 = obj.report()\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Dart",
|
||
"langSlug": "dart",
|
||
"code": "class MovieRentingSystem {\n\n MovieRentingSystem(int n, List<List<int>> entries) {\n \n }\n \n List<int> search(int movie) {\n \n }\n \n void rent(int shop, int movie) {\n \n }\n \n void drop(int shop, int movie) {\n \n }\n \n List<List<int>> report() {\n \n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * MovieRentingSystem obj = MovieRentingSystem(n, entries);\n * List<int> param1 = obj.search(movie);\n * obj.rent(shop,movie);\n * obj.drop(shop,movie);\n * List<List<int>> param4 = obj.report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Go",
|
||
"langSlug": "golang",
|
||
"code": "type MovieRentingSystem struct {\n\n}\n\n\nfunc Constructor(n int, entries [][]int) MovieRentingSystem {\n\n}\n\n\nfunc (this *MovieRentingSystem) Search(movie int) []int {\n\n}\n\n\nfunc (this *MovieRentingSystem) Rent(shop int, movie int) {\n\n}\n\n\nfunc (this *MovieRentingSystem) Drop(shop int, movie int) {\n\n}\n\n\nfunc (this *MovieRentingSystem) Report() [][]int {\n\n}\n\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * obj := Constructor(n, entries);\n * param_1 := obj.Search(movie);\n * obj.Rent(shop,movie);\n * obj.Drop(shop,movie);\n * param_4 := obj.Report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Ruby",
|
||
"langSlug": "ruby",
|
||
"code": "class MovieRentingSystem\n\n=begin\n :type n: Integer\n :type entries: Integer[][]\n=end\n def initialize(n, entries)\n\n end\n\n\n=begin\n :type movie: Integer\n :rtype: Integer[]\n=end\n def search(movie)\n\n end\n\n\n=begin\n :type shop: Integer\n :type movie: Integer\n :rtype: Void\n=end\n def rent(shop, movie)\n\n end\n\n\n=begin\n :type shop: Integer\n :type movie: Integer\n :rtype: Void\n=end\n def drop(shop, movie)\n\n end\n\n\n=begin\n :rtype: Integer[][]\n=end\n def report()\n\n end\n\n\nend\n\n# Your MovieRentingSystem object will be instantiated and called as such:\n# obj = MovieRentingSystem.new(n, entries)\n# param_1 = obj.search(movie)\n# obj.rent(shop, movie)\n# obj.drop(shop, movie)\n# param_4 = obj.report()",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Scala",
|
||
"langSlug": "scala",
|
||
"code": "class MovieRentingSystem(_n: Int, _entries: Array[Array[Int]]) {\n\n def search(movie: Int): List[Int] = {\n\n }\n\n def rent(shop: Int, movie: Int) {\n\n }\n\n def drop(shop: Int, movie: Int) {\n\n }\n\n def report(): List[List[Int]] = {\n\n }\n\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * var obj = new MovieRentingSystem(n, entries)\n * var param_1 = obj.search(movie)\n * obj.rent(shop,movie)\n * obj.drop(shop,movie)\n * var param_4 = obj.report()\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Rust",
|
||
"langSlug": "rust",
|
||
"code": "struct MovieRentingSystem {\n\n}\n\n\n/**\n * `&self` means the method takes an immutable reference.\n * If you need a mutable reference, change it to `&mut self` instead.\n */\nimpl MovieRentingSystem {\n\n fn new(n: i32, entries: Vec<Vec<i32>>) -> Self {\n\n }\n \n fn search(&self, movie: i32) -> Vec<i32> {\n\n }\n \n fn rent(&self, shop: i32, movie: i32) {\n\n }\n \n fn drop(&self, shop: i32, movie: i32) {\n\n }\n \n fn report(&self) -> Vec<Vec<i32>> {\n\n }\n}\n\n/**\n * Your MovieRentingSystem object will be instantiated and called as such:\n * let obj = MovieRentingSystem::new(n, entries);\n * let ret_1: Vec<i32> = obj.search(movie);\n * obj.rent(shop, movie);\n * obj.drop(shop, movie);\n * let ret_4: Vec<Vec<i32>> = obj.report();\n */",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Racket",
|
||
"langSlug": "racket",
|
||
"code": "(define movie-renting-system%\n (class object%\n (super-new)\n \n ; n : exact-integer?\n ; entries : (listof (listof exact-integer?))\n (init-field\n n\n entries)\n \n ; search : exact-integer? -> (listof exact-integer?)\n (define/public (search movie)\n )\n ; rent : exact-integer? exact-integer? -> void?\n (define/public (rent shop movie)\n )\n ; drop : exact-integer? exact-integer? -> void?\n (define/public (drop shop movie)\n )\n ; report : -> (listof (listof exact-integer?))\n (define/public (report)\n )))\n\n;; Your movie-renting-system% object will be instantiated and called as such:\n;; (define obj (new movie-renting-system% [n n] [entries entries]))\n;; (define param_1 (send obj search movie))\n;; (send obj rent shop movie)\n;; (send obj drop shop movie)\n;; (define param_4 (send obj report))",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Erlang",
|
||
"langSlug": "erlang",
|
||
"code": "-spec movie_renting_system_init_(N :: integer(), Entries :: [[integer()]]) -> any().\nmovie_renting_system_init_(N, Entries) ->\n .\n\n-spec movie_renting_system_search(Movie :: integer()) -> [integer()].\nmovie_renting_system_search(Movie) ->\n .\n\n-spec movie_renting_system_rent(Shop :: integer(), Movie :: integer()) -> any().\nmovie_renting_system_rent(Shop, Movie) ->\n .\n\n-spec movie_renting_system_drop(Shop :: integer(), Movie :: integer()) -> any().\nmovie_renting_system_drop(Shop, Movie) ->\n .\n\n-spec movie_renting_system_report() -> [[integer()]].\nmovie_renting_system_report() ->\n .\n\n\n%% Your functions will be called as such:\n%% movie_renting_system_init_(N, Entries),\n%% Param_1 = movie_renting_system_search(Movie),\n%% movie_renting_system_rent(Shop, Movie),\n%% movie_renting_system_drop(Shop, Movie),\n%% Param_4 = movie_renting_system_report(),\n\n%% movie_renting_system_init_ will be called before every test case, in which you can do some necessary initializations.",
|
||
"__typename": "CodeSnippetNode"
|
||
},
|
||
{
|
||
"lang": "Elixir",
|
||
"langSlug": "elixir",
|
||
"code": "defmodule MovieRentingSystem do\n @spec init_(n :: integer, entries :: [[integer]]) :: any\n def init_(n, entries) do\n \n end\n\n @spec search(movie :: integer) :: [integer]\n def search(movie) do\n \n end\n\n @spec rent(shop :: integer, movie :: integer) :: any\n def rent(shop, movie) do\n \n end\n\n @spec drop(shop :: integer, movie :: integer) :: any\n def drop(shop, movie) do\n \n end\n\n @spec report() :: [[integer]]\n def report() do\n \n end\nend\n\n# Your functions will be called as such:\n# MovieRentingSystem.init_(n, entries)\n# param_1 = MovieRentingSystem.search(movie)\n# MovieRentingSystem.rent(shop, movie)\n# MovieRentingSystem.drop(shop, movie)\n# param_4 = MovieRentingSystem.report()\n\n# MovieRentingSystem.init_ will be called before every test case, in which you can do some necessary initializations.",
|
||
"__typename": "CodeSnippetNode"
|
||
}
|
||
],
|
||
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"18.9K\", \"totalAcceptedRaw\": 4578, \"totalSubmissionRaw\": 18850, \"acRate\": \"24.3%\"}",
|
||
"hints": [
|
||
"You need to maintain a sorted list for each movie and a sorted list for rented movies",
|
||
"When renting a movie remove it from its movies sorted list and added it to the rented list and vice versa in the case of dropping a movie"
|
||
],
|
||
"solution": null,
|
||
"status": null,
|
||
"sampleTestCase": "[\"MovieRentingSystem\",\"search\",\"rent\",\"rent\",\"report\",\"drop\",\"search\"]\n[[3,[[0,1,5],[0,2,6],[0,3,7],[1,1,4],[1,2,7],[2,1,5]]],[1],[0,1],[1,2],[],[1,2],[2]]",
|
||
"metaData": "{\n \"classname\": \"MovieRentingSystem\",\n \"constructor\": {\n \"params\": [\n {\n \"type\": \"integer\",\n \"name\": \"n\"\n },\n {\n \"name\": \"entries\",\n \"type\": \"integer[][]\"\n }\n ]\n },\n \"methods\": [\n {\n \"params\": [\n {\n \"type\": \"integer\",\n \"name\": \"movie\"\n }\n ],\n \"name\": \"search\",\n \"return\": {\n \"type\": \"list<integer>\"\n }\n },\n {\n \"params\": [\n {\n \"type\": \"integer\",\n \"name\": \"shop\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"movie\"\n }\n ],\n \"name\": \"rent\",\n \"return\": {\n \"type\": \"void\"\n }\n },\n {\n \"params\": [\n {\n \"type\": \"integer\",\n \"name\": \"shop\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"movie\"\n }\n ],\n \"name\": \"drop\",\n \"return\": {\n \"type\": \"void\"\n }\n },\n {\n \"params\": [],\n \"name\": \"report\",\n \"return\": {\n \"type\": \"list<list<integer>>\"\n }\n }\n ],\n \"return\": {\n \"type\": \"boolean\"\n },\n \"systemdesign\": true,\n \"manual\": false\n}",
|
||
"judgerAvailable": true,
|
||
"judgeType": "large",
|
||
"mysqlSchemas": [],
|
||
"enableRunCode": true,
|
||
"envInfo": "{\"cpp\":[\"C++\",\"<p>\\u7248\\u672c\\uff1a<code>clang 11<\\/code> \\u91c7\\u7528\\u6700\\u65b0C++ 20\\u6807\\u51c6\\u3002<\\/p>\\r\\n\\r\\n<p>\\u7f16\\u8bd1\\u65f6\\uff0c\\u5c06\\u4f1a\\u91c7\\u7528<code>-O2<\\/code>\\u7ea7\\u4f18\\u5316\\u3002<a href=\\\"https:\\/\\/github.com\\/google\\/sanitizers\\/wiki\\/AddressSanitizer\\\" target=\\\"_blank\\\">AddressSanitizer<\\/a> \\u4e5f\\u88ab\\u5f00\\u542f\\u6765\\u68c0\\u6d4b<code>out-of-bounds<\\/code>\\u548c<code>use-after-free<\\/code>\\u9519\\u8bef\\u3002<\\/p>\\r\\n\\r\\n<p>\\u4e3a\\u4e86\\u4f7f\\u7528\\u65b9\\u4fbf\\uff0c\\u5927\\u90e8\\u5206\\u6807\\u51c6\\u5e93\\u7684\\u5934\\u6587\\u4ef6\\u5df2\\u7ecf\\u88ab\\u81ea\\u52a8\\u5bfc\\u5165\\u3002<\\/p>\"],\"java\":[\"Java\",\"<p>\\u7248\\u672c\\uff1a<code>OpenJDK 17<\\/code>\\u3002\\u53ef\\u4ee5\\u4f7f\\u7528Java 8\\u7684\\u7279\\u6027\\u4f8b\\u5982\\uff0clambda expressions \\u548c stream API\\u3002<\\/p>\\r\\n\\r\\n<p>\\u4e3a\\u4e86\\u65b9\\u4fbf\\u8d77\\u89c1\\uff0c\\u5927\\u90e8\\u5206\\u6807\\u51c6\\u5e93\\u7684\\u5934\\u6587\\u4ef6\\u5df2\\u88ab\\u5bfc\\u5165\\u3002<\\/p>\\r\\n\\r\\n<p>\\u5305\\u542b Pair \\u7c7b: https:\\/\\/docs.oracle.com\\/javase\\/8\\/javafx\\/api\\/javafx\\/util\\/Pair.html <\\/p>\"],\"python\":[\"Python\",\"<p>\\u7248\\u672c\\uff1a <code>Python 2.7.12<\\/code><\\/p>\\r\\n\\r\\n<p>\\u4e3a\\u4e86\\u65b9\\u4fbf\\u8d77\\u89c1\\uff0c\\u5927\\u90e8\\u5206\\u5e38\\u7528\\u5e93\\u5df2\\u7ecf\\u88ab\\u81ea\\u52a8 \\u5bfc\\u5165\\uff0c\\u5982\\uff1a<a href=\\\"https:\\/\\/docs.python.org\\/2\\/library\\/array.html\\\" target=\\\"_blank\\\">array<\\/a>, <a href=\\\"https:\\/\\/docs.python.org\\/2\\/library\\/bisect.html\\\" target=\\\"_blank\\\">bisect<\\/a>, <a href=\\\"https:\\/\\/docs.python.org\\/2\\/library\\/collections.html\\\" target=\\\"_blank\\\">collections<\\/a>\\u3002\\u5982\\u679c\\u60a8\\u9700\\u8981\\u4f7f\\u7528\\u5176\\u4ed6\\u5e93\\u51fd\\u6570\\uff0c\\u8bf7\\u81ea\\u884c\\u5bfc\\u5165\\u3002<\\/p>\\r\\n\\r\\n<p>\\u6ce8\\u610f Python 2.7 <a href=\\\"https:\\/\\/www.python.org\\/dev\\/peps\\/pep-0373\\/\\\" target=\\\"_blank\\\">\\u5c06\\u57282020\\u5e74\\u540e\\u4e0d\\u518d\\u7ef4\\u62a4<\\/a>\\u3002 \\u5982\\u60f3\\u4f7f\\u7528\\u6700\\u65b0\\u7248\\u7684Python\\uff0c\\u8bf7\\u9009\\u62e9Python 3\\u3002<\\/p>\"],\"c\":[\"C\",\"<p>\\u7248\\u672c\\uff1a<code>GCC 8.2<\\/code>\\uff0c\\u91c7\\u7528GNU11\\u6807\\u51c6\\u3002<\\/p>\\r\\n\\r\\n<p>\\u7f16\\u8bd1\\u65f6\\uff0c\\u5c06\\u4f1a\\u91c7\\u7528<code>-O1<\\/code>\\u7ea7\\u4f18\\u5316\\u3002 <a href=\\\"https:\\/\\/github.com\\/google\\/sanitizers\\/wiki\\/AddressSanitizer\\\" target=\\\"_blank\\\">AddressSanitizer<\\/a>\\u4e5f\\u88ab\\u5f00\\u542f\\u6765\\u68c0\\u6d4b<code>out-of-bounds<\\/code>\\u548c<code>use-after-free<\\/code>\\u9519\\u8bef\\u3002<\\/p>\\r\\n\\r\\n<p>\\u4e3a\\u4e86\\u4f7f\\u7528\\u65b9\\u4fbf\\uff0c\\u5927\\u90e8\\u5206\\u6807\\u51c6\\u5e93\\u7684\\u5934\\u6587\\u4ef6\\u5df2\\u7ecf\\u88ab\\u81ea\\u52a8\\u5bfc\\u5165\\u3002<\\/p>\\r\\n\\r\\n<p>\\u5982\\u60f3\\u4f7f\\u7528\\u54c8\\u5e0c\\u8868\\u8fd0\\u7b97, \\u60a8\\u53ef\\u4ee5\\u4f7f\\u7528 <a href=\\\"https:\\/\\/troydhanson.github.io\\/uthash\\/\\\" target=\\\"_blank\\\">uthash<\\/a>\\u3002 \\\"uthash.h\\\"\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5bfc\\u5165\\u3002\\u8bf7\\u770b\\u5982\\u4e0b\\u793a\\u4f8b:<\\/p>\\r\\n\\r\\n<p><b>1. \\u5f80\\u54c8\\u5e0c\\u8868\\u4e2d\\u6dfb\\u52a0\\u4e00\\u4e2a\\u5bf9\\u8c61\\uff1a<\\/b>\\r\\n<pre>\\r\\nstruct hash_entry {\\r\\n int id; \\/* we'll use this field as the key *\\/\\r\\n char name[10];\\r\\n UT_hash_handle hh; \\/* makes this structure hashable *\\/\\r\\n};\\r\\n\\r\\nstruct hash_entry *users = NULL;\\r\\n\\r\\nvoid add_user(struct hash_entry *s) {\\r\\n HASH_ADD_INT(users, id, s);\\r\\n}\\r\\n<\\/pre>\\r\\n<\\/p>\\r\\n\\r\\n<p><b>2. \\u5728\\u54c8\\u5e0c\\u8868\\u4e2d\\u67e5\\u627e\\u4e00\\u4e2a\\u5bf9\\u8c61\\uff1a<\\/b>\\r\\n<pre>\\r\\nstruct hash_entry *find_user(int user_id) {\\r\\n struct hash_entry *s;\\r\\n HASH_FIND_INT(users, &user_id, s);\\r\\n return s;\\r\\n}\\r\\n<\\/pre>\\r\\n<\\/p>\\r\\n\\r\\n<p><b>3. \\u4ece\\u54c8\\u5e0c\\u8868\\u4e2d\\u5220\\u9664\\u4e00\\u4e2a\\u5bf9\\u8c61\\uff1a<\\/b>\\r\\n<pre>\\r\\nvoid delete_user(struct hash_entry *user) {\\r\\n HASH_DEL(users, user); \\r\\n}\\r\\n<\\/pre>\\r\\n<\\/p>\"],\"csharp\":[\"C#\",\"<p><a href=\\\"https:\\/\\/docs.microsoft.com\\/en-us\\/dotnet\\/csharp\\/whats-new\\/csharp-9\\\" target=\\\"_blank\\\">C# 10<\\/a> \\u8fd0\\u884c\\u5728 .NET 6 \\u4e0a<\\/p>\"],\"javascript\":[\"JavaScript\",\"<p>\\u7248\\u672c\\uff1a<code>Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a <code>--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f <a href=\\\"http:\\/\\/node.green\\/\\\" target=\\\"_blank\\\">\\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"ruby\":[\"Ruby\",\"<p>\\u4f7f\\u7528<code>Ruby 3.1<\\/code>\\u6267\\u884c<\\/p>\\r\\n\\r\\n<p>\\u4e00\\u4e9b\\u5e38\\u7528\\u7684\\u6570\\u636e\\u7ed3\\u6784\\u5df2\\u5728 Algorithms \\u6a21\\u5757\\u4e2d\\u63d0\\u4f9b\\uff1ahttps:\\/\\/www.rubydoc.info\\/github\\/kanwei\\/algorithms\\/Algorithms<\\/p>\"],\"swift\":[\"Swift\",\"<p>\\u7248\\u672c\\uff1a<code>Swift 5.5.2<\\/code><\\/p>\\r\\n\\r\\n<p>\\u6211\\u4eec\\u901a\\u5e38\\u4fdd\\u8bc1\\u66f4\\u65b0\\u5230 <a href=\\\"https:\\/\\/swift.org\\/download\\/\\\" target=\\\"_blank\\\">Apple\\u653e\\u51fa\\u7684\\u6700\\u65b0\\u7248Swift<\\/a>\\u3002\\u5982\\u679c\\u60a8\\u53d1\\u73b0Swift\\u4e0d\\u662f\\u6700\\u65b0\\u7248\\u7684\\uff0c\\u8bf7\\u8054\\u7cfb\\u6211\\u4eec\\uff01\\u6211\\u4eec\\u5c06\\u5c3d\\u5feb\\u66f4\\u65b0\\u3002<\\/p>\"],\"golang\":[\"Go\",\"<p>\\u7248\\u672c\\uff1a<code>Go 1.21<\\/code><\\/p>\\r\\n\\r\\n<p>\\u652f\\u6301 <a href=\\\"https:\\/\\/github.com\\/emirpasic\\/gods\\/tree\\/v1.18.1\\\" target=\\\"_blank\\\">https:\\/\\/godoc.org\\/github.com\\/emirpasic\\/gods@v1.18.1<\\/a> \\u7b2c\\u4e09\\u65b9\\u5e93\\u3002<\\/p>\"],\"python3\":[\"Python3\",\"<p>\\u7248\\u672c\\uff1a<code>Python 3.10<\\/code><\\/p>\\r\\n\\r\\n<p>\\u4e3a\\u4e86\\u65b9\\u4fbf\\u8d77\\u89c1\\uff0c\\u5927\\u90e8\\u5206\\u5e38\\u7528\\u5e93\\u5df2\\u7ecf\\u88ab\\u81ea\\u52a8 \\u5bfc\\u5165\\uff0c\\u5982<a href=\\\"https:\\/\\/docs.python.org\\/3\\/library\\/array.html\\\" target=\\\"_blank\\\">array<\\/a>, <a href=\\\"https:\\/\\/docs.python.org\\/3\\/library\\/bisect.html\\\" target=\\\"_blank\\\">bisect<\\/a>, <a href=\\\"https:\\/\\/docs.python.org\\/3\\/library\\/collections.html\\\" target=\\\"_blank\\\">collections<\\/a>\\u3002 \\u5982\\u679c\\u60a8\\u9700\\u8981\\u4f7f\\u7528\\u5176\\u4ed6\\u5e93\\u51fd\\u6570\\uff0c\\u8bf7\\u81ea\\u884c\\u5bfc\\u5165\\u3002<\\/p>\\r\\n\\r\\n<p>\\u5982\\u9700\\u4f7f\\u7528 Map\\/TreeMap \\u6570\\u636e\\u7ed3\\u6784\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"http:\\/\\/www.grantjenks.com\\/docs\\/sortedcontainers\\/\\\" target=\\\"_blank\\\">sortedcontainers<\\/a> \\u5e93\\u3002<\\/p>\"],\"scala\":[\"Scala\",\"<p>\\u7248\\u672c\\uff1a<code>Scala 2.13<\\/code><\\/p>\"],\"kotlin\":[\"Kotlin\",\"<p>\\u7248\\u672c\\uff1a<code>Kotlin 1.9.0<\\/code><\\/p>\\r\\n\\r\\n<p>\\u6211\\u4eec\\u4f7f\\u7528\\u7684\\u662f JetBrains \\u63d0\\u4f9b\\u7684 experimental compiler\\u3002\\u5982\\u679c\\u60a8\\u8ba4\\u4e3a\\u60a8\\u9047\\u5230\\u4e86\\u7f16\\u8bd1\\u5668\\u76f8\\u5173\\u7684\\u95ee\\u9898\\uff0c\\u8bf7\\u5411\\u6211\\u4eec\\u53cd\\u9988<\\/p>\"],\"rust\":[\"Rust\",\"<p>\\u7248\\u672c\\uff1a<code>rust 1.58.1<\\/code><\\/p>\\r\\n\\r\\n<p>\\u652f\\u6301 crates.io \\u7684 <a href=\\\"https:\\/\\/crates.io\\/crates\\/rand\\\" target=\\\"_blank\\\">rand<\\/a><\\/p>\"],\"php\":[\"PHP\",\"<p><code>PHP 8.1<\\/code>.<\\/p>\\r\\n\\r\\n<p>With bcmath module.<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 5.1.6<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2022<\\/p>\\r\\n\\r\\n<p><a href=\\\"https:\\/\\/lodash.com\\\" target=\\\"_blank\\\">lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n<p> \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/priority-queue\\/tree\\/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"racket\":[\"Racket\",\"<p><a href=\\\"https:\\/\\/docs.racket-lang.org\\/guide\\/performance.html#%28tech._c%29\\\" target=\\\"_blank\\\">Racket CS<\\/a> v8.3<\\/p>\\r\\n\\r\\n<p>\\u4f7f\\u7528 #lang racket<\\/p>\\r\\n\\r\\n<p>\\u5df2\\u9884\\u5148 (require data\\/gvector data\\/queue data\\/order data\\/heap). \\u82e5\\u9700\\u4f7f\\u7528\\u5176\\u5b83\\u6570\\u636e\\u7ed3\\u6784\\uff0c\\u53ef\\u81ea\\u884c require\\u3002<\\/p>\"],\"erlang\":[\"Erlang\",\"Erlang\\/OTP 24.2\"],\"elixir\":[\"Elixir\",\"Elixir 1.13.0 with Erlang\\/OTP 24.2\"],\"dart\":[\"Dart\",\"<p>Dart 2.17.3<\\/p>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5c06\\u4f1a\\u88ab\\u4e0d\\u7f16\\u8bd1\\u76f4\\u63a5\\u8fd0\\u884c<\\/p>\"]}",
|
||
"book": null,
|
||
"isSubscribed": false,
|
||
"isDailyQuestion": false,
|
||
"dailyRecordStatus": null,
|
||
"editorType": "CKEDITOR",
|
||
"ugcQuestionId": null,
|
||
"style": "LEETCODE",
|
||
"exampleTestcases": "[\"MovieRentingSystem\",\"search\",\"rent\",\"rent\",\"report\",\"drop\",\"search\"]\n[[3,[[0,1,5],[0,2,6],[0,3,7],[1,1,4],[1,2,7],[2,1,5]]],[1],[0,1],[1,2],[],[1,2],[2]]",
|
||
"__typename": "QuestionNode"
|
||
}
|
||
}
|
||
} |