mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 22:42:52 +08:00
update
This commit is contained in:
46
leetcode/originData/[no content]color-the-triangle-red.json
Normal file
46
leetcode/originData/[no content]color-the-triangle-red.json
Normal file
File diff suppressed because one or more lines are too long
163
leetcode/originData/calculate-delayed-arrival-time.json
Normal file
163
leetcode/originData/calculate-delayed-arrival-time.json
Normal file
File diff suppressed because one or more lines are too long
193
leetcode/originData/cousins-in-binary-tree-ii.json
Normal file
193
leetcode/originData/cousins-in-binary-tree-ii.json
Normal file
File diff suppressed because one or more lines are too long
60
leetcode/originData/design-cancellable-function.json
Normal file
60
leetcode/originData/design-cancellable-function.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
168
leetcode/originData/find-the-maximum-divisibility-score.json
Normal file
168
leetcode/originData/find-the-maximum-divisibility-score.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
174
leetcode/originData/find-the-width-of-columns-of-a-grid.json
Normal file
174
leetcode/originData/find-the-width-of-columns-of-a-grid.json
Normal file
File diff suppressed because one or more lines are too long
61
leetcode/originData/generate-fibonacci-sequence.json
Normal file
61
leetcode/originData/generate-fibonacci-sequence.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2775",
|
||||
"questionFrontendId": "2648",
|
||||
"boundTopicId": null,
|
||||
"title": "Generate Fibonacci Sequence",
|
||||
"titleSlug": "generate-fibonacci-sequence",
|
||||
"content": "<p>Write a generator function that returns a generator object which yields the <strong>fibonacci sequence</strong>.</p>\n\n<p>The <strong>fibonacci sequence</strong> is defined by the relation <code>X<sub>n</sub> = X<sub>n-1</sub> + X<sub>n-2</sub></code>.</p>\n\n<p>The first few numbers of the series are <code>0, 1, 1, 2, 3, 5, 8, 13</code>.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> callCount = 5\n<strong>Output:</strong> [0,1,1,2,3]\n<strong>Explanation:</strong>\nconst gen = fibGenerator();\ngen.next().value; // 0\ngen.next().value; // 1\ngen.next().value; // 1\ngen.next().value; // 2\ngen.next().value; // 3\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> callCount = 0\n<strong>Output:</strong> []\n<strong>Explanation:</strong> gen.next() is never called so nothing is outputted\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>0 <= callCount <= 50</code></li>\n</ul>\n",
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 18,
|
||||
"dislikes": 2,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Nested Array Generator\", \"titleSlug\": \"nested-array-generator\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Design Cancellable Function\", \"titleSlug\": \"design-cancellable-function\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "5\n0",
|
||||
"categoryTitle": "JavaScript",
|
||||
"contributors": [],
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @return {Generator<number>}\n */\nvar fibGenerator = function*() {\n \n};\n\n/**\n * const gen = fibGenerator();\n * gen.next().value; // 0\n * gen.next().value; // 1\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "function* fibGenerator(): Generator<number, any, number> {\n\n};\n\n/**\n * const gen = fibGenerator();\n * gen.next().value; // 0\n * gen.next().value; // 1\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"688\", \"totalSubmission\": \"815\", \"totalAcceptedRaw\": 688, \"totalSubmissionRaw\": 815, \"acRate\": \"84.4%\"}",
|
||||
"hints": [
|
||||
"Javascript has the concept of generators. They are critical to this problem.",
|
||||
"First yield 0 and 1.",
|
||||
"Create an infinite \"while(true)\" loop.",
|
||||
"In that loop, continuously yield the next value which is the sum of the previous two."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "5",
|
||||
"metaData": "{\n \"name\": \"fibGenerator\",\n \"params\": [\n {\n \"name\": \"callCount\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"integer[]\"\n },\n \"languages\": [\n \"typescript\",\n \"javascript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": false,
|
||||
"envInfo": "{\"javascript\": [\"JavaScript\", \"<p><code>Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES6 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\\r\\n\\r\\n<p>For Priority Queue / Queue data structures, you may use 5.3.0 version of <a href=\\\"https://github.com/datastructures-js/priority-queue/tree/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\">datastructures-js/priority-queue</a> and 4.2.1 version of <a href=\\\"https://github.com/datastructures-js/queue/tree/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\">datastructures-js/queue</a>.</p>\"], \"typescript\": [\"Typescript\", \"<p><code>TypeScript 4.5.4, Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES2020 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
187
leetcode/originData/minimize-the-total-price-of-the-trips.json
Normal file
187
leetcode/originData/minimize-the-total-price-of-the-trips.json
Normal file
File diff suppressed because one or more lines are too long
186
leetcode/originData/minimum-additions-to-make-valid-string.json
Normal file
186
leetcode/originData/minimum-additions-to-make-valid-string.json
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
60
leetcode/originData/nested-array-generator.json
Normal file
60
leetcode/originData/nested-array-generator.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"data": {
|
||||
"question": {
|
||||
"questionId": "2783",
|
||||
"questionFrontendId": "2649",
|
||||
"boundTopicId": null,
|
||||
"title": "Nested Array Generator",
|
||||
"titleSlug": "nested-array-generator",
|
||||
"content": "<p>Given a <strong>multi-dimensional array</strong> of integers, return a generator object which yields integers in the same order as <strong>inorder traversal</strong>.</p>\n\n<p>A <strong>multi-dimensional array</strong> is a recursive data structure that contains both integers and other <strong>multi-dimensional arrays</strong>.</p>\n\n<p><strong>inorder traversal</strong> iterates over each array from left to right, yielding any integers it encounters or applying <strong>inorder traversal</strong> to any arrays it encounters.</p>\n\n<p> </p>\n<p><strong class=\"example\">Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = [[[6]],[1,3],[]]\n<strong>Output:</strong> [6,1,3]\n<strong>Explanation:</strong>\nconst generator = inorderTraversal(arr);\ngenerator.next().value; // 6\ngenerator.next().value; // 1\ngenerator.next().value; // 3\ngenerator.next().done; // true\n</pre>\n\n<p><strong class=\"example\">Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> arr = []\n<strong>Output:</strong> []\n<strong>Explanation:</strong> There are no integers so the generator doesn't yield anything.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>0 <= arr.flat().length <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= arr.flat()[i] <= 10<sup>5</sup></code></li>\n\t<li><code>maxNestingDepth <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"translatedTitle": null,
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 14,
|
||||
"dislikes": 1,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Generate Fibonacci Sequence\", \"titleSlug\": \"generate-fibonacci-sequence\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Design Cancellable Function\", \"titleSlug\": \"design-cancellable-function\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "[[[6]],[1,3],[]]\n[]",
|
||||
"categoryTitle": "JavaScript",
|
||||
"contributors": [],
|
||||
"topicTags": [],
|
||||
"companyTagStats": null,
|
||||
"codeSnippets": [
|
||||
{
|
||||
"lang": "JavaScript",
|
||||
"langSlug": "javascript",
|
||||
"code": "/**\n * @param {Array} arr\n * @return {Generator}\n */\nvar inorderTraversal = function*(arr) {\n \n};\n\n/**\n * const gen = inorderTraversal([1, [2, 3]]);\n * gen.next().value; // 1\n * gen.next().value; // 2\n * gen.next().value; // 3\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
},
|
||||
{
|
||||
"lang": "TypeScript",
|
||||
"langSlug": "typescript",
|
||||
"code": "type MultidimensionalArray = (MultidimensionalArray | number)[]\n\nfunction* inorderTraversal(arr: MultidimensionalArray): Generator<number, void, unknown> {\n\n};\n\n/**\n * const gen = inorderTraversal([1, [2, 3]]);\n * gen.next().value; // 1\n * gen.next().value; // 2\n * gen.next().value; // 3\n */",
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"320\", \"totalSubmission\": \"391\", \"totalAcceptedRaw\": 320, \"totalSubmissionRaw\": 391, \"acRate\": \"81.8%\"}",
|
||||
"hints": [
|
||||
"Generator functions can pass control to another generator function with \"yield*\" syntax.",
|
||||
"Generator functions can recursively yield control to themselves.",
|
||||
"You don't need to worry about recursion depth for this problem."
|
||||
],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
"sampleTestCase": "[[[6]],[1,3],[]]",
|
||||
"metaData": "{\n \"name\": \"inorderTraveral\",\n \"params\": [\n {\n \"name\": \"arr\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"integer[]\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
|
||||
"judgerAvailable": true,
|
||||
"judgeType": "large",
|
||||
"mysqlSchemas": [],
|
||||
"enableRunCode": true,
|
||||
"enableTestMode": false,
|
||||
"enableDebugger": false,
|
||||
"envInfo": "{\"javascript\": [\"JavaScript\", \"<p><code>Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES6 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\\r\\n\\r\\n<p>For Priority Queue / Queue data structures, you may use 5.3.0 version of <a href=\\\"https://github.com/datastructures-js/priority-queue/tree/fb4fdb984834421279aeb081df7af624d17c2a03\\\" target=\\\"_blank\\\">datastructures-js/priority-queue</a> and 4.2.1 version of <a href=\\\"https://github.com/datastructures-js/queue/tree/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\">datastructures-js/queue</a>.</p>\"], \"typescript\": [\"Typescript\", \"<p><code>TypeScript 4.5.4, Node.js 16.13.2</code>.</p>\\r\\n\\r\\n<p>Your code is run with <code>--harmony</code> flag, enabling <a href=\\\"http://node.green/\\\" target=\\\"_blank\\\">new ES2020 features</a>.</p>\\r\\n\\r\\n<p><a href=\\\"https://lodash.com\\\" target=\\\"_blank\\\">lodash.js</a> library is included by default.</p>\"]}",
|
||||
"libraryUrl": null,
|
||||
"adminUrl": null,
|
||||
"challengeQuestion": null,
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
}
|
173
leetcode/originData/row-with-maximum-ones.json
Normal file
173
leetcode/originData/row-with-maximum-ones.json
Normal file
File diff suppressed because one or more lines are too long
161
leetcode/originData/sliding-subarray-beauty.json
Normal file
161
leetcode/originData/sliding-subarray-beauty.json
Normal file
File diff suppressed because one or more lines are too long
160
leetcode/originData/sum-multiples.json
Normal file
160
leetcode/originData/sum-multiples.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user