{ "data": { "question": { "questionId": "2769", "questionFrontendId": "2675", "categoryTitle": "JavaScript", "boundTopicId": 2267107, "title": "Array of Objects to Matrix", "titleSlug": "array-of-objects-to-matrix", "content": null, "translatedTitle": "将对象数组转换为矩阵", "translatedContent": null, "isPaidOnly": true, "difficulty": "Hard", "likes": 2, "dislikes": 0, "isLiked": null, "similarQuestions": "[]", "contributors": [], "langToValidPlayground": null, "topicTags": [], "companyTagStats": null, "codeSnippets": null, "stats": "{\"totalAccepted\": \"751\", \"totalSubmission\": \"1.3K\", \"totalAcceptedRaw\": 751, \"totalSubmissionRaw\": 1314, \"acRate\": \"57.2%\"}", "hints": [ "How could you split the problem up into sub-problems?", "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.", "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." ], "solution": null, "status": null, "sampleTestCase": "[{\"b\":1,\"a\":2},{\"b\":3,\"a\":4}]", "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}", "judgerAvailable": true, "judgeType": "large", "mysqlSchemas": [], "enableRunCode": true, "envInfo": "{\"javascript\":[\"JavaScript\",\"
\\u7248\\u672c\\uff1a \\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u6267\\u884c\\u65f6\\u5c06\\u5e26\\u4e0a lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"],\"typescript\":[\"TypeScript\",\" TypeScript 5.1.6<\\/p>\\r\\n\\r\\n Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2022<\\/p>\\r\\n\\r\\n lodash.js<\\/a> \\u5e93\\u5df2\\u7ecf\\u9ed8\\u8ba4\\u88ab\\u5305\\u542b\\u3002<\\/p>\\r\\n\\r\\n \\u5982\\u9700\\u4f7f\\u7528\\u961f\\u5217\\/\\u4f18\\u5148\\u961f\\u5217\\uff0c\\u60a8\\u53ef\\u4f7f\\u7528 datastructures-js\\/priority-queue@5.3.0<\\/a> \\u548c datastructures-js\\/queue@4.2.1<\\/a>\\u3002<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"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[{},{},{}]",
"__typename": "QuestionNode"
}
}
}Node.js 16.13.2<\\/code><\\/p>\\r\\n\\r\\n
--harmony<\\/code> \\u6807\\u8bb0\\u6765\\u5f00\\u542f \\u65b0\\u7248ES6\\u7279\\u6027<\\/a>\\u3002<\\/p>\\r\\n\\r\\n