Skip to content

Commit 9bc4722

Browse files
committed
update
1 parent c9b1bf3 commit 9bc4722

File tree

349 files changed

+15897
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+15897
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"data": {
3+
"question": {
4+
"questionId": "2769",
5+
"questionFrontendId": "2675",
6+
"categoryTitle": "JavaScript",
7+
"boundTopicId": 2267107,
8+
"title": "Array of Objects to Matrix",
9+
"titleSlug": "array-of-objects-to-matrix",
10+
"content": null,
11+
"translatedTitle": "将对象数组转换为矩阵",
12+
"translatedContent": null,
13+
"isPaidOnly": true,
14+
"difficulty": "Hard",
15+
"likes": 2,
16+
"dislikes": 0,
17+
"isLiked": null,
18+
"similarQuestions": "[]",
19+
"contributors": [],
20+
"langToValidPlayground": null,
21+
"topicTags": [],
22+
"companyTagStats": null,
23+
"codeSnippets": null,
24+
"stats": "{\"totalAccepted\": \"751\", \"totalSubmission\": \"1.3K\", \"totalAcceptedRaw\": 751, \"totalSubmissionRaw\": 1314, \"acRate\": \"57.2%\"}",
25+
"hints": [
26+
"How could you split the problem up into sub-problems?",
27+
"1.) Write a function that converts a single object into a dictionary that maps the path name to values. You can solve this recursively by keeping track of current path list.",
28+
"2.) Write a function that converts a list of dictionaries into a matrix. Start by creating a list of all possible paths in any of the dictionaries. This will represent the columns."
29+
],
30+
"solution": null,
31+
"status": null,
32+
"sampleTestCase": "[{\"b\":1,\"a\":2},{\"b\":3,\"a\":4}]",
33+
"metaData": "{\n \"name\": \"jsonToMatrix\",\n \"params\": [\n {\n \"name\": \"arr\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"string\"\n },\n \"languages\": [\n \"typescript\",\n \"javascript\"\n ],\n \"manual\": true\n}",
34+
"judgerAvailable": true,
35+
"judgeType": "large",
36+
"mysqlSchemas": [],
37+
"enableRunCode": true,
38+
"envInfo": "{\"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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/p>\"]}",
39+
"book": null,
40+
"isSubscribed": false,
41+
"isDailyQuestion": false,
42+
"dailyRecordStatus": null,
43+
"editorType": "CKEDITOR",
44+
"ugcQuestionId": null,
45+
"style": "LEETCODE",
46+
"exampleTestcases": "[{\"b\":1,\"a\":2},{\"b\":3,\"a\":4}]\n[{\"a\":1,\"b\":2},{\"c\":3,\"d\":4},{}]\n[{\"a\":{\"b\":1,\"c\":2}},{\"a\":{\"b\":3,\"d\":4}}]\n[[{\"a\":null}],[{\"b\":true}],[{\"c\":\"x\"}]]\n[{},{},{}]",
47+
"__typename": "QuestionNode"
48+
}
49+
}
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"data": {
3+
"question": {
4+
"questionId": "2745",
5+
"questionFrontendId": "2633",
6+
"categoryTitle": "JavaScript",
7+
"boundTopicId": 2222275,
8+
"title": "Convert Object to JSON String",
9+
"titleSlug": "convert-object-to-json-string",
10+
"content": null,
11+
"translatedTitle": "将对象转换为 JSON 字符串",
12+
"translatedContent": null,
13+
"isPaidOnly": true,
14+
"difficulty": "Medium",
15+
"likes": 3,
16+
"dislikes": 0,
17+
"isLiked": null,
18+
"similarQuestions": "[]",
19+
"contributors": [],
20+
"langToValidPlayground": null,
21+
"topicTags": [],
22+
"companyTagStats": null,
23+
"codeSnippets": null,
24+
"stats": "{\"totalAccepted\": \"1.3K\", \"totalSubmission\": \"2.2K\", \"totalAcceptedRaw\": 1300, \"totalSubmissionRaw\": 2202, \"acRate\": \"59.0%\"}",
25+
"hints": [
26+
"Consider the 4 possibilities. The object could be an array, an object, a string, or another type.",
27+
"Think about the problem recursively. If you know how to convert any sub-data into a string, how could you use it to convert the entire data into a string?",
28+
"If the data is a string, it's just the value surrounded by double quotes. If the data is another type, its just String(data). If the data is an array, it's the recursively stringified value of each item separated by commas. If the data is an object, it's a series of key-value pairs where each value is the recursively stringified value."
29+
],
30+
"solution": null,
31+
"status": null,
32+
"sampleTestCase": "{\"y\":1,\"x\":2}",
33+
"metaData": "{\n \"name\": \"jsonStringify\",\n \"params\": [\n {\n \"name\": \"object\",\n \"type\": \"string\"\n }\n ],\n \"return\": {\n \"type\": \"string\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
34+
"judgerAvailable": true,
35+
"judgeType": "large",
36+
"mysqlSchemas": [],
37+
"enableRunCode": true,
38+
"envInfo": "{\"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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/p>\"]}",
39+
"book": null,
40+
"isSubscribed": false,
41+
"isDailyQuestion": false,
42+
"dailyRecordStatus": null,
43+
"editorType": "CKEDITOR",
44+
"ugcQuestionId": null,
45+
"style": "LEETCODE",
46+
"exampleTestcases": "{\"y\":1,\"x\":2}\n{\"a\":\"str\",\"b\":-12,\"c\":true,\"d\":null}\n{\"key\":{\"a\":1,\"b\":[{},null,\"Hello\"]}}\ntrue",
47+
"__typename": "QuestionNode"
48+
}
49+
}
50+
}

Diff for: leetcode-cn/originData/[no content]curry.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"data": {
3+
"question": {
4+
"questionId": "2740",
5+
"questionFrontendId": "2632",
6+
"categoryTitle": "JavaScript",
7+
"boundTopicId": 2222271,
8+
"title": "Curry",
9+
"titleSlug": "curry",
10+
"content": null,
11+
"translatedTitle": "柯里化",
12+
"translatedContent": null,
13+
"isPaidOnly": true,
14+
"difficulty": "Medium",
15+
"likes": 14,
16+
"dislikes": 0,
17+
"isLiked": null,
18+
"similarQuestions": "[]",
19+
"contributors": [],
20+
"langToValidPlayground": null,
21+
"topicTags": [],
22+
"companyTagStats": null,
23+
"codeSnippets": null,
24+
"stats": "{\"totalAccepted\": \"1.9K\", \"totalSubmission\": \"2.3K\", \"totalAcceptedRaw\": 1850, \"totalSubmissionRaw\": 2255, \"acRate\": \"82.0%\"}",
25+
"hints": [
26+
"You can access the count of parameters expected to passed into a function with \"fn.length\".",
27+
"You can use recursion. If the length of params passed is equal to fn.length, you are done. Just pass those params to fn. Otherwise return a function that is includes the previous passed params plus the new params. The new function should contain a recursive call to curry()."
28+
],
29+
"solution": null,
30+
"status": null,
31+
"sampleTestCase": "function sum(a, b, c) { return a + b + c; }\n[[1],[2],[3]]",
32+
"metaData": "{\n \"name\": \"curry\",\n \"params\": [\n {\n \"name\": \"fn\",\n \"type\": \"string\"\n },\n {\n \"type\": \"integer[][]\",\n \"name\": \"inputs\"\n }\n ],\n \"return\": {\n \"type\": \"string\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
33+
"judgerAvailable": true,
34+
"judgeType": "large",
35+
"mysqlSchemas": [],
36+
"enableRunCode": true,
37+
"envInfo": "{\"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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/p>\"]}",
38+
"book": null,
39+
"isSubscribed": false,
40+
"isDailyQuestion": false,
41+
"dailyRecordStatus": null,
42+
"editorType": "CKEDITOR",
43+
"ugcQuestionId": null,
44+
"style": "LEETCODE",
45+
"exampleTestcases": "function sum(a, b, c) { return a + b + c; }\n[[1],[2],[3]]\nfunction sum(a, b, c) { return a + b + c; }\n[[1,2],[3]]\nfunction sum(a, b, c) { return a + b + c; }\n[[],[],[1,2,3]]\nfunction life() { return 42; }\n[[]]",
46+
"__typename": "QuestionNode"
47+
}
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"data": {
3+
"question": {
4+
"questionId": "2774",
5+
"questionFrontendId": "2700",
6+
"categoryTitle": "JavaScript",
7+
"boundTopicId": 2278876,
8+
"title": "Differences Between Two Objects",
9+
"titleSlug": "differences-between-two-objects",
10+
"content": null,
11+
"translatedTitle": "两个对象之间的差异",
12+
"translatedContent": null,
13+
"isPaidOnly": true,
14+
"difficulty": "Medium",
15+
"likes": 2,
16+
"dislikes": 0,
17+
"isLiked": null,
18+
"similarQuestions": "[]",
19+
"contributors": [],
20+
"langToValidPlayground": null,
21+
"topicTags": [],
22+
"companyTagStats": null,
23+
"codeSnippets": null,
24+
"stats": "{\"totalAccepted\": \"614\", \"totalSubmission\": \"1.1K\", \"totalAcceptedRaw\": 614, \"totalSubmissionRaw\": 1067, \"acRate\": \"57.5%\"}",
25+
"hints": [
26+
"Find the intersection of the keys/indices on the two arrays/objects.",
27+
"Analyze the data structure recursively.",
28+
"For each key in the intersection, omit if there are no differences in the leaves. Otherwise return the difference."
29+
],
30+
"solution": null,
31+
"status": null,
32+
"sampleTestCase": "{}\n{\"a\": 1, \"b\": 2}",
33+
"metaData": "{\n \"name\": \"objDiff\",\n \"params\": [\n {\n \"name\": \"obj1\",\n \"type\": \"string\"\n },\n {\n \"type\": \"string\",\n \"name\": \"obj2\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n },\n \"languages\": [\n \"javascript\",\n \"typescript\"\n ],\n \"manual\": true\n}",
34+
"judgerAvailable": true,
35+
"judgeType": "large",
36+
"mysqlSchemas": [],
37+
"enableRunCode": true,
38+
"envInfo": "{\"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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/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\\/[email protected]<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\/tree\\/e63563025a5a805aa16928cb53bcd517bfea9230\\\" target=\\\"_blank\\\"> datastructures-js\\/[email protected]<\\/a>\\u3002<\\/p>\"]}",
39+
"book": null,
40+
"isSubscribed": false,
41+
"isDailyQuestion": false,
42+
"dailyRecordStatus": null,
43+
"editorType": "CKEDITOR",
44+
"ugcQuestionId": null,
45+
"style": "LEETCODE",
46+
"exampleTestcases": "{}\n{\"a\": 1, \"b\": 2}\n{\"a\": 1, \"v\": 3, \"x\": [], \"z\": {\"a\": null}}\n{\"a\": 2, \"v\": 4, \"x\": [], \"z\": {\"a\": 2}}\n{\"a\": 5, \"v\": 6, \"z\": [1,2,4, [2,5,7]]}\n{\"a\": 5, \"v\": 7, \"z\": [1,2,3, [1]]}\n{\"a\":{\"b\":1}}\n{\"a\":[5]}\n{\"a\": [1, 2, {}],\"b\": false}\n{\"b\": false, \"a\": [1, 2, {}]}",
47+
"__typename": "QuestionNode"
48+
}
49+
}
50+
}

0 commit comments

Comments
 (0)