1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/originData/flatten-a-multilevel-doubly-linked-list.json
2022-05-02 23:44:12 +08:00

144 lines
23 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"data": {
"question": {
"questionId": "766",
"questionFrontendId": "430",
"categoryTitle": "Algorithms",
"boundTopicId": 1736,
"title": "Flatten a Multilevel Doubly Linked List",
"titleSlug": "flatten-a-multilevel-doubly-linked-list",
"content": "<p>You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional <strong>child pointer</strong>. This child pointer may or may not point to a separate doubly linked list, also containing these special nodes. These child lists may have one or more children of their own, and so on, to produce a <strong>multilevel data structure</strong> as shown in the example below.</p>\n\n<p>Given the <code>head</code> of the first level of the list, <strong>flatten</strong> the list so that all the nodes appear in a single-level, doubly linked list. Let <code>curr</code> be a node with a child list. The nodes in the child list should appear <strong>after</strong> <code>curr</code> and <strong>before</strong> <code>curr.next</code> in the flattened list.</p>\n\n<p>Return <em>the </em><code>head</code><em> of the flattened list. The nodes in the list must have <strong>all</strong> of their child pointers set to </em><code>null</code>.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten11.jpg\" style=\"width: 700px; height: 339px;\" />\n<pre>\n<strong>Input:</strong> head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n<strong>Output:</strong> [1,2,3,7,8,11,12,9,10,4,5,6]\n<strong>Explanation:</strong> The multilevel linked list in the input is shown.\nAfter flattening the multilevel linked list it becomes:\n<img src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten12.jpg\" style=\"width: 1000px; height: 69px;\" />\n</pre>\n\n<p><strong>Example 2:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten2.1jpg\" style=\"width: 200px; height: 200px;\" />\n<pre>\n<strong>Input:</strong> head = [1,2,null,3]\n<strong>Output:</strong> [1,3,2]\n<strong>Explanation:</strong> The multilevel linked list in the input is shown.\nAfter flattening the multilevel linked list it becomes:\n<img src=\"https://assets.leetcode.com/uploads/2021/11/24/list.jpg\" style=\"width: 300px; height: 87px;\" />\n</pre>\n\n<p><strong>Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> head = []\n<strong>Output:</strong> []\n<strong>Explanation:</strong> There could be empty list in the input.\n</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li>The number of Nodes will not exceed <code>1000</code>.</li>\n\t<li><code>1 &lt;= Node.val &lt;= 10<sup>5</sup></code></li>\n</ul>\n\n<p>&nbsp;</p>\n<p><strong>How the multilevel linked list is represented in test cases:</strong></p>\n\n<p>We use the multilevel linked list from <strong>Example 1</strong> above:</p>\n\n<pre>\n 1---2---3---4---5---6--NULL\n |\n 7---8---9---10--NULL\n |\n 11--12--NULL</pre>\n\n<p>The serialization of each level is as follows:</p>\n\n<pre>\n[1,2,3,4,5,6,null]\n[7,8,9,10,null]\n[11,12,null]\n</pre>\n\n<p>To serialize all levels together, we will add nulls in each level to signify no node connects to the upper node of the previous level. The serialization becomes:</p>\n\n<pre>\n[1, 2, 3, 4, 5, 6, null]\n |\n[null, null, 7, 8, 9, 10, null]\n |\n[ null, 11, 12, null]\n</pre>\n\n<p>Merging the serialization of each level and removing trailing nulls we obtain:</p>\n\n<pre>\n[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n</pre>\n",
"translatedTitle": "扁平化多级双向链表",
"translatedContent": "<p>你会得到一个双链表,其中包含的节点有一个下一个指针、一个前一个指针和一个额外的 <strong>子指针</strong> 。这个子指针可能指向一个单独的双向链表,也包含这些特殊的节点。这些子列表可以有一个或多个自己的子列表,以此类推,以生成如下面的示例所示的 <strong>多层数据结构</strong> 。</p>\n\n<p>给定链表的头节点&nbsp;<font color=\"#c7254e\"><font face=\"Menlo, Monaco, Consolas, Courier New, monospace\"><span style=\"font-size:12.6px\"><span style=\"background-color:#f9f2f4\">head</span></span></font></font>&nbsp;,将链表 <strong>扁平化</strong> ,以便所有节点都出现在单层双链表中。让 <code>curr</code> 是一个带有子列表的节点。子列表中的节点应该出现在<strong>扁平化列表</strong>中的&nbsp;<code>curr</code> <strong>之后</strong> 和&nbsp;<code>curr.next</code>&nbsp;<strong>之前</strong> 。</p>\n\n<p>返回 <em>扁平列表的 <code>head</code>&nbsp;。列表中的节点必须将其 <strong>所有</strong> 子指针设置为&nbsp;<code>null</code>&nbsp;。</em></p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten11.jpg\" style=\"height:339px; width:700px\" /></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n<strong>输出:</strong>[1,2,3,7,8,11,12,9,10,4,5,6]\n<strong>解释:</strong>输入的多级列表如上图所示。\n扁平化后的链表如下图\n<img src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten12.jpg\" style=\"height:69px; width:1000px\" />\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/11/09/flatten2.1jpg\" style=\"height:200px; width:200px\" /></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2,null,3]\n<strong>输出:</strong>[1,3,2]\n<strong>解释:</strong>输入的多级列表如上图所示。\n扁平化后的链表如下图\n<img src=\"https://assets.leetcode.com/uploads/2021/11/24/list.jpg\" style=\"height:87px; width:300px\" />\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>head = []\n<strong>输出:</strong>[]\n<strong>说明:</strong>输入中可能存在空列表。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>节点数目不超过 <code>1000</code></li>\n\t<li><code>1 &lt;= Node.val &lt;= 10<sup>5</sup></code></li>\n</ul>\n\n<p>&nbsp;</p>\n\n<p><strong>如何表示测试用例中的多级链表?</strong></p>\n\n<p>以 <strong>示例 1</strong> 为例:</p>\n\n<pre>\n 1---2---3---4---5---6--NULL\n |\n 7---8---9---10--NULL\n |\n 11--12--NULL</pre>\n\n<p>序列化其中的每一级之后:</p>\n\n<pre>\n[1,2,3,4,5,6,null]\n[7,8,9,10,null]\n[11,12,null]\n</pre>\n\n<p>为了将每一级都序列化到一起,我们需要每一级中添加值为 null 的元素,以表示没有节点连接到上一级的上级节点。</p>\n\n<pre>\n[1,2,3,4,5,6,null]\n[null,null,7,8,9,10,null]\n[null,11,12,null]\n</pre>\n\n<p>合并所有序列化结果,并去除末尾的 null 。</p>\n\n<pre>\n[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n</pre>\n\n<ul>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 343,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Flatten Binary Tree to Linked List\", \"titleSlug\": \"flatten-binary-tree-to-linked-list\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u4e8c\\u53c9\\u6811\\u5c55\\u5f00\\u4e3a\\u94fe\\u8868\"}]",
"contributors": [],
"langToValidPlayground": "{\"cpp\": true, \"java\": true, \"python\": true, \"python3\": true, \"mysql\": false, \"mssql\": false, \"oraclesql\": false, \"c\": false, \"csharp\": false, \"javascript\": false, \"ruby\": false, \"bash\": false, \"swift\": false, \"golang\": false, \"scala\": false, \"html\": false, \"pythonml\": false, \"kotlin\": false, \"rust\": false, \"php\": false, \"typescript\": false, \"racket\": false, \"erlang\": false, \"elixir\": false}",
"topicTags": [
{
"name": "Depth-First Search",
"slug": "depth-first-search",
"translatedName": "深度优先搜索",
"__typename": "TopicTagNode"
},
{
"name": "Linked List",
"slug": "linked-list",
"translatedName": "链表",
"__typename": "TopicTagNode"
},
{
"name": "Doubly-Linked List",
"slug": "doubly-linked-list",
"translatedName": "双向链表",
"__typename": "TopicTagNode"
}
],
"companyTagStats": null,
"codeSnippets": [
{
"lang": "C++",
"langSlug": "cpp",
"code": "/*\n// Definition for a Node.\nclass Node {\npublic:\n int val;\n Node* prev;\n Node* next;\n Node* child;\n};\n*/\n\nclass Solution {\npublic:\n Node* flatten(Node* head) {\n \n }\n};",
"__typename": "CodeSnippetNode"
},
{
"lang": "Java",
"langSlug": "java",
"code": "/*\n// Definition for a Node.\nclass Node {\n public int val;\n public Node prev;\n public Node next;\n public Node child;\n};\n*/\n\nclass Solution {\n public Node flatten(Node head) {\n \n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "Python",
"langSlug": "python",
"code": "\"\"\"\n# Definition for a Node.\nclass Node(object):\n def __init__(self, val, prev, next, child):\n self.val = val\n self.prev = prev\n self.next = next\n self.child = child\n\"\"\"\n\nclass Solution(object):\n def flatten(self, head):\n \"\"\"\n :type head: Node\n :rtype: Node\n \"\"\"\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "Python3",
"langSlug": "python3",
"code": "\"\"\"\n# Definition for a Node.\nclass Node:\n def __init__(self, val, prev, next, child):\n self.val = val\n self.prev = prev\n self.next = next\n self.child = child\n\"\"\"\n\nclass Solution:\n def flatten(self, head: 'Node') -> 'Node':\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "C#",
"langSlug": "csharp",
"code": "/*\n// Definition for a Node.\npublic class Node {\n public int val;\n public Node prev;\n public Node next;\n public Node child;\n}\n*/\n\npublic class Solution {\n public Node Flatten(Node head) {\n \n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "JavaScript",
"langSlug": "javascript",
"code": "/**\n * // Definition for a Node.\n * function Node(val,prev,next,child) {\n * this.val = val;\n * this.prev = prev;\n * this.next = next;\n * this.child = child;\n * };\n */\n\n/**\n * @param {Node} head\n * @return {Node}\n */\nvar flatten = function(head) {\n \n};",
"__typename": "CodeSnippetNode"
},
{
"lang": "Ruby",
"langSlug": "ruby",
"code": "# Definition for a Node.\n# class Node\n# attr_accessor :val, :prev, :next, :child\n# def initialize(val=nil, prev=nil, next_=nil, child=nil)\n# @val = val\n# @prev = prev\n# @next = next_\n# @child = child\n# end\n# end\n\n# @param {Node} root\n# @return {Node}\ndef flatten(root)\n \nend",
"__typename": "CodeSnippetNode"
},
{
"lang": "Swift",
"langSlug": "swift",
"code": "/**\n * Definition for a Node.\n * public class Node {\n * public var val: Int\n * public var prev: Node?\n * public var next: Node?\n * public var child: Node?\n * public init(_ val: Int) {\n * self.val = val\n * self.prev = nil\n * self.next = nil\n * self.child = nil\n * }\n * }\n */\n\nclass Solution {\n func flatten(_ head: Node?) -> Node? {\n \n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "Go",
"langSlug": "golang",
"code": "/**\n * Definition for a Node.\n * type Node struct {\n * Val int\n * Prev *Node\n * Next *Node\n * Child *Node\n * }\n */\n\nfunc flatten(root *Node) *Node {\n \n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "Scala",
"langSlug": "scala",
"code": "/**\n * Definition for a Node.\n * class Node(var _value: Int) {\n * var value: Int = _value\n * var prev: Node = null\n * var next: Node = null\n * var child: Node = null\n * }\n */\n\nobject Solution {\n def flatten(head: Node): Node = {\n \t\n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "Kotlin",
"langSlug": "kotlin",
"code": "/**\n * Definition for a Node.\n * class Node(var `val`: Int) {\n * var prev: Node? = null\n * var next: Node? = null\n * var child: Node? = null\n * }\n */\n\nclass Solution {\n fun flatten(root: Node?): Node? {\n \n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "PHP",
"langSlug": "php",
"code": "/**\n * Definition for a Node.\n * class Node {\n * public $val = null;\n * public $prev = null;\n * public $next = null;\n * public $child = null;\n * function __construct($val = 0) {\n * $this->val = $val;\n * $this->prev = null;\n * $this->next = null;\n * $this->child = null;\n * }\n * }\n */\n\nclass Solution {\n /**\n * @param Node $head\n * @return Node\n */\n function flatten($head) {\n \n }\n}",
"__typename": "CodeSnippetNode"
},
{
"lang": "TypeScript",
"langSlug": "typescript",
"code": "/**\n * Definition for node.\n * class Node {\n * val: number\n * prev: Node | null\n * next: Node | null\n * child: Node | null\n * constructor(val?: number, prev? : Node, next? : Node, child? : Node) {\n * this.val = (val===undefined ? 0 : val);\n * this.prev = (prev===undefined ? null : prev);\n * this.next = (next===undefined ? null : next);\n * this.child = (child===undefined ? null : child);\n * }\n * }\n */\n\nfunction flatten(head: Node | null): Node | null {\n\n};",
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"50.4K\", \"totalSubmission\": \"85.2K\", \"totalAcceptedRaw\": 50383, \"totalSubmissionRaw\": 85227, \"acRate\": \"59.1%\"}",
"hints": [],
"solution": null,
"status": null,
"sampleTestCase": "[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]",
"metaData": "{\n \"name\": \"flatten\",\n \"params\": [\n {\n \"name\": \"head\",\n \"type\": \"ListNode\"\n }\n ],\n \"return\": {\n \"type\": \"ListNode\"\n },\n \"languages\": [\n \"cpp\",\n \"java\",\n \"python\",\n \"csharp\",\n \"javascript\",\n \"python3\",\n \"kotlin\",\n \"ruby\",\n \"scala\",\n \"golang\",\n \"swift\",\n \"php\",\n \"typescript\"\n ],\n \"manual\": true\n}",
"judgerAvailable": true,
"judgeType": "large",
"mysqlSchemas": [],
"enableRunCode": true,
"envInfo": "{\"cpp\":[\"C++\",\"<p>\\u7248\\u672c\\uff1a<code>clang 11<\\/code> \\u91c7\\u7528\\u6700\\u65b0C++ 17\\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>\"],\"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>\\r\\n\\r\\n<p>\\u60a8\\u7684\\u4ee3\\u7801\\u5728\\u7f16\\u8bd1\\u65f6\\u9ed8\\u8ba4\\u5f00\\u542f\\u4e86debug\\u6807\\u8bb0(<code>\\/debug:pdbonly<\\/code>)\\u3002<\\/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\\\" target=\\\"_blank\\\"> datastructures-js\\/priority-queue<\\/a> \\u548c <a href=\\\"https:\\/\\/github.com\\/datastructures-js\\/queue\\\" target=\\\"_blank\\\"> datastructures-js\\/queue<\\/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.17<\\/code><\\/p>\\r\\n\\r\\n<p>\\u652f\\u6301 <a href=\\\"https:\\/\\/godoc.org\\/github.com\\/emirpasic\\/gods\\\" target=\\\"_blank\\\">https:\\/\\/godoc.org\\/github.com\\/emirpasic\\/gods<\\/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.3.10<\\/code><\\/p>\"],\"php\":[\"PHP\",\"<p><code>PHP 8.1<\\/code>.<\\/p>\\r\\n\\r\\n<p>With bcmath module.<\\/p>\"],\"typescript\":[\"TypeScript\",\"<p>TypeScript 4.5.4<\\/p>\\r\\n\\r\\n<p>Compile Options: --alwaysStrict --strictBindCallApply --strictFunctionTypes --target ES2020<\\/p>\"]}",
"book": null,
"isSubscribed": false,
"isDailyQuestion": false,
"dailyRecordStatus": null,
"editorType": "CKEDITOR",
"ugcQuestionId": null,
"style": "LEETCODE",
"exampleTestcases": "[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n[1,2,null,3]\n[]",
"__typename": "QuestionNode"
}
}
}