2022-03-27 20:37:52 +08:00
{
"data" : {
"question" : {
"questionId" : "1456" ,
"questionFrontendId" : "1334" ,
"categoryTitle" : "Algorithms" ,
"boundTopicId" : 79199 ,
"title" : "Find the City With the Smallest Number of Neighbors at a Threshold Distance" ,
"titleSlug" : "find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance" ,
"content" : "<p>There are <code>n</code> cities numbered from <code>0</code> to <code>n-1</code>. Given the array <code>edges</code> where <code>edges[i] = [from<sub>i</sub>, to<sub>i</sub>, weight<sub>i</sub>]</code> represents a bidirectional and weighted edge between cities <code>from<sub>i</sub></code> and <code>to<sub>i</sub></code>, and given the integer <code>distanceThreshold</code>.</p>\n\n<p>Return the city with the smallest number of cities that are reachable through some path and whose distance is <strong>at most</strong> <code>distanceThreshold</code>, If there are multiple such cities, return the city with the greatest number.</p>\n\n<p>Notice that the distance of a path connecting cities <em><strong>i</strong></em> and <em><strong>j</strong></em> is equal to the sum of the edges' weights along that path.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/01/16/find_the_city_01.png\" style=\"width: 300px; height: 225px;\" />\n<pre>\n<strong>Input:</strong> n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4\n<strong>Output:</strong> 3\n<strong>Explanation: </strong>The figure above describes the graph. \nThe neighboring cities at a distanceThreshold = 4 for each city are:\nCity 0 -> [City 1, City 2] \nCity 1 -> [City 0, City 2, City 3] \nCity 2 -> [City 0, City 1, City 3] \nCity 3 -> [City 1, City 2] \nCities 0 and 3 have 2 neighboring cities at a distanceThreshold = 4, but we have to return city 3 since it has the greatest number.\n</pre>\n\n<p><strong>Example 2:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/01/16/find_the_city_02.png\" style=\"width: 300px; height: 225px;\" />\n<pre>\n<strong>Input:</strong> n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2\n<strong>Output:</strong> 0\n<strong>Explanation: </strong>The figure above describes the graph. \nThe neighboring cities at a distanceThreshold = 2 for each city are:\nCity 0 -> [City 1] \nCity 1 -> [City 0, City 4] \nCity 2 -> [City 3, City 4] \nCity 3 -> [City 2, City 4]\nCity 4 -> [City 1, City 2, City 3] \nThe city 0 has 1 neighboring city at a distanceThreshold = 2.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>2 <= n <= 100</code></li>\n\t<li><code>1 <= edges.length <= n * (n - 1) / 2</code></li>\n\t<li><code>edges[i].length == 3</code></li>\n\t<li><code>0 <= from<sub>i</sub> < to<sub>i</sub> < n</code></li>\n\t<li><code>1 <= weight<sub>i</sub>, distanceThreshold <= 10^4</code></li>\n\t<li>All pairs <code>(from<sub>i</sub>, to<sub>i</sub>)</code> are distinct.</li>\n</ul>\n" ,
"translatedTitle" : "阈值距离内邻居最少的城市" ,
"translatedContent" : "<p>有 <code>n</code> 个城市,按从 <code>0</code> 到 <code>n-1</code> 编号。给你一个边数组 <code>edges</code>,其中 <code>edges[i] = [from<sub>i</sub>, to<sub>i</sub>, weight<sub>i</sub>]</code> 代表 <code>from<sub>i</sub></code> 和 <code>to<sub>i</sub></code><sub> </sub>两个城市之间的双向加权边,距离阈值是一个整数 <code>distanceThreshold</code>。</p>\n\n<p>返回能通过某些路径到达其他城市数目最少、且路径距离 <strong>最大</strong> 为 <code>distanceThreshold</code> 的城市。如果有多个这样的城市,则返回编号最大的城市。</p>\n\n<p>注意,连接城市 <em><strong>i</strong></em> 和 <em><strong>j</strong></em> 的路径的距离等于沿该路径的所有边的权重之和。</p>\n\n<p> </p>\n\n<p><strong>示例 1: </strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/01/26/find_the_city_01.png\" style=\"height: 225px; width: 300px;\" /></p>\n\n<pre>\n<strong>输入:</strong>n = 4, edges = [[0,1,3],[1,2,1],[1,3,4],[2,3,1]], distanceThreshold = 4\n<strong>输出:</strong>3\n<strong>解释:</strong>城市分布图如上。\n每个城市阈值距离 distanceThreshold = 4 内的邻居城市分别是:\n城市 0 -> [城市 1, 城市 2] \n城市 1 -> [城市 0, 城市 2, 城市 3] \n城市 2 -> [城市 0, 城市 1, 城市 3] \n城市 3 -> [城市 1, 城市 2] \n城市 0 和 3 在阈值距离 4 以内都有 2 个邻居城市,但是我们必须返回城市 3, 因为它的编号最大。\n</pre>\n\n<p><strong>示例 2: </strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/01/26/find_the_city_02.png\" style=\"height: 225px; width: 300px;\" /></strong></p>\n\n<pre>\n<strong>输入:</strong>n = 5, edges = [[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]], distanceThreshold = 2\n<strong>输出:</strong>0\n<strong>解释:</strong>城市分布图如上。 \n每个城市阈值距离 distanceThreshold = 2 内的邻居城市分别是:\n城市 0 -> [城市 1] \n城市 1 -> [城市 0, 城市 4] \n城市 2 -> [城市 3, 城市 4] \n城市 3 -> [城市 2, 城市 4]\n城市 4 -> [城市 1, 城市 2, 城市 3] \n城市 0 在阈值距离 2 以内只有 1 个邻居城市。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= n <= 100</code></li>\n\t<li><code>1 <= edges.length <= n * (n - 1) / 2</code></li>\n\t<li><code>edges[i].length == 3</code></li>\n\t<li><code>0 <= from<sub>i</sub> < to<sub>i</sub> < n</code></li>\n\t<li><code>1 <= weight<sub>i</sub>, distanceThreshold <= 10^4</code></li>\n\t<li>所有 <code>(from<sub>i</sub>, to<sub>i</sub>)</code> 都是不同的。</li>\n</ul>\n" ,
"isPaidOnly" : false ,
"difficulty" : "Medium" ,
2022-03-29 16:56:27 +08:00
"likes" : 77 ,
2022-03-27 20:37:52 +08:00
"dislikes" : 0 ,
"isLiked" : null ,
"similarQuestions" : "[]" ,
"contributors" : [ ] ,
"langToValidPlayground" : "{\"cpp\": false, \"java\": true, \"python\": true, \"python3\": false, \"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" : "Graph" ,
"slug" : "graph" ,
"translatedName" : "图" ,
"__typename" : "TopicTagNode"
} ,
{
"name" : "Dynamic Programming" ,
"slug" : "dynamic-programming" ,
"translatedName" : "动态规划" ,
"__typename" : "TopicTagNode"
} ,
{
"name" : "Shortest Path" ,
"slug" : "shortest-path" ,
"translatedName" : "最短路" ,
"__typename" : "TopicTagNode"
}
] ,
"companyTagStats" : null ,
"codeSnippets" : [
{
"lang" : "C++" ,
"langSlug" : "cpp" ,
"code" : "class Solution {\npublic:\n int findTheCity(int n, vector<vector<int>>& edges, int distanceThreshold) {\n\n }\n};" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Java" ,
"langSlug" : "java" ,
"code" : "class Solution {\n public int findTheCity(int n, int[][] edges, int distanceThreshold) {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Python" ,
"langSlug" : "python" ,
"code" : "class Solution(object):\n def findTheCity(self, n, edges, distanceThreshold):\n \"\"\"\n :type n: int\n :type edges: List[List[int]]\n :type distanceThreshold: int\n :rtype: int\n \"\"\"" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Python3" ,
"langSlug" : "python3" ,
"code" : "class Solution:\n def findTheCity(self, n: int, edges: List[List[int]], distanceThreshold: int) -> int:" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "C" ,
"langSlug" : "c" ,
"code" : "\n\nint findTheCity(int n, int** edges, int edgesSize, int* edgesColSize, int distanceThreshold){\n\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "C#" ,
"langSlug" : "csharp" ,
"code" : "public class Solution {\n public int FindTheCity(int n, int[][] edges, int distanceThreshold) {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "JavaScript" ,
"langSlug" : "javascript" ,
"code" : "/**\n * @param {number} n\n * @param {number[][]} edges\n * @param {number} distanceThreshold\n * @return {number}\n */\nvar findTheCity = function(n, edges, distanceThreshold) {\n\n};" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Ruby" ,
"langSlug" : "ruby" ,
"code" : "# @param {Integer} n\n# @param {Integer[][]} edges\n# @param {Integer} distance_threshold\n# @return {Integer}\ndef find_the_city(n, edges, distance_threshold)\n\nend" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Swift" ,
"langSlug" : "swift" ,
"code" : "class Solution {\n func findTheCity(_ n: Int, _ edges: [[Int]], _ distanceThreshold: Int) -> Int {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Go" ,
"langSlug" : "golang" ,
"code" : "func findTheCity(n int, edges [][]int, distanceThreshold int) int {\n\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Scala" ,
"langSlug" : "scala" ,
"code" : "object Solution {\n def findTheCity(n: Int, edges: Array[Array[Int]], distanceThreshold: Int): Int = {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Kotlin" ,
"langSlug" : "kotlin" ,
"code" : "class Solution {\n fun findTheCity(n: Int, edges: Array<IntArray>, distanceThreshold: Int): Int {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Rust" ,
"langSlug" : "rust" ,
"code" : "impl Solution {\n pub fn find_the_city(n: i32, edges: Vec<Vec<i32>>, distance_threshold: i32) -> i32 {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "PHP" ,
"langSlug" : "php" ,
"code" : "class Solution {\n\n /**\n * @param Integer $n\n * @param Integer[][] $edges\n * @param Integer $distanceThreshold\n * @return Integer\n */\n function findTheCity($n, $edges, $distanceThreshold) {\n\n }\n}" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "TypeScript" ,
"langSlug" : "typescript" ,
"code" : "function findTheCity(n: number, edges: number[][], distanceThreshold: number): number {\n\n};" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Racket" ,
"langSlug" : "racket" ,
"code" : "(define/contract (find-the-city n edges distanceThreshold)\n (-> exact-integer? (listof (listof exact-integer?)) exact-integer? exact-integer?)\n\n )" ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Erlang" ,
"langSlug" : "erlang" ,
"code" : "-spec find_the_city(N :: integer(), Edges :: [[integer()]], DistanceThreshold :: integer()) -> integer().\nfind_the_city(N, Edges, DistanceThreshold) ->\n ." ,
"__typename" : "CodeSnippetNode"
} ,
{
"lang" : "Elixir" ,
"langSlug" : "elixir" ,
"code" : "defmodule Solution do\n @spec find_the_city(n :: integer, edges :: [[integer]], distance_threshold :: integer) :: integer\n def find_the_city(n, edges, distance_threshold) do\n\n end\nend" ,
"__typename" : "CodeSnippetNode"
}
] ,
2022-05-02 23:44:12 +08:00
"stats" : "{\"totalAccepted\": \"7.6K\", \"totalSubmission\": \"14.8K\", \"totalAcceptedRaw\": 7552, \"totalSubmissionRaw\": 14846, \"acRate\": \"50.9%\"}" ,
2022-03-27 20:37:52 +08:00
"hints" : [
"Use Floyd-Warshall's algorithm to compute any-point to any-point distances. (Or can also do Dijkstra from every node due to the weights are non-negative)." ,
"For each city calculate the number of reachable cities within the threshold, then search for the optimal city."
] ,
"solution" : null ,
"status" : null ,
"sampleTestCase" : "4\n[[0,1,3],[1,2,1],[1,3,4],[2,3,1]]\n4" ,
"metaData" : "{\n \"name\": \"findTheCity\",\n \"params\": [\n {\n \"name\": \"n\",\n \"type\": \"integer\"\n },\n {\n \"type\": \"integer[][]\",\n \"name\": \"edges\"\n },\n {\n \"type\": \"integer\",\n \"name\": \"distanceThreshold\"\n }\n ],\n \"return\": {\n \"type\": \"integer\"\n }\n}" ,
"judgerAvailable" : true ,
"judgeType" : "large" ,
"mysqlSchemas" : [ ] ,
"enableRunCode" : true ,
"envInfo" : " { \ " c p p \ " : [ \ " C + + \ " , \ " < p > \ \ u 7 2 4 8 \ \ u 6 7 2 c \ \ u f f 1 a < c o d e > c l a n g 1 1 < \ \ / c o d e > \ \ u 9 1 c 7 \ \ u 7 5 2 8 \ \ u 6 7 0 0 \ \ u 6 5 b 0 C + + 1 7 \ \ u 6 8 0 7 \ \ u 5 1 c 6 \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 7 f 1 6 \ \ u 8 b d 1 \ \ u 6 5 f 6 \ \ u f f 0 c \ \ u 5 c 0 6 \ \ u 4 f 1 a \ \ u 9 1 c 7 \ \ u 7 5 2 8 < c o d e > - O 2 < \ \ / c o d e > \ \ u 7 e a 7 \ \ u 4 f 1 8 \ \ u 5 3 1 6 \ \ u 3 0 0 2 < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / g i t h u b . c o m \ \ / g o o g l e \ \ / s a n i t i z e r s \ \ / w i k i \ \ / A d d r e s s S a n i t i z e r \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > A d d r e s s S a n i t i z e r < \ \ / a > \ \ u 4 e 5 f \ \ u 8 8 a b \ \ u 5 f 0 0 \ \ u 5 4 2 f \ \ u 6 7 6 5 \ \ u 6 8 c 0 \ \ u 6 d 4 b < c o d e > o u t - o f - b o u n d s < \ \ / c o d e > \ \ u 5 4 8 c < c o d e > u s e - a f t e r - f r e e < \ \ / c o d e > \ \ u 9 5 1 9 \ \ u 8 b e f \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 4 e 3 a \ \ u 4 e 8 6 \ \ u 4 f 7 f \ \ u 7 5 2 8 \ \ u 6 5 b 9 \ \ u 4 f b f \ \ u f f 0 c \ \ u 5 9 2 7 \ \ u 9 0 e 8 \ \ u 5 2 0 6 \ \ u 6 8 0 7 \ \ u 5 1 c 6 \ \ u 5 e 9 3 \ \ u 7 6 8 4 \ \ u 5 9 3 4 \ \ u 6 5 8 7 \ \ u 4 e f 6 \ \ u 5 d f 2 \ \ u 7 e c f \ \ u 8 8 a b \ \ u 8 1 e a \ \ u 5 2 a 8 \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u 3 0 0 2 < \ \ / p > \ " ] , \ " j a v a \ " : [ \ " J a v a \ " , \ " < p > \ \ u 7 2 4 8 \ \ u 6 7 2 c \ \ u f f 1 a < c o d e > O p e n J D K 1 7 < \ \ / c o d e > \ \ u 3 0 0 2 \ \ u 5 3 e f \ \ u 4 e e 5 \ \ u 4 f 7 f \ \ u 7 5 2 8 J a v a 8 \ \ u 7 6 8 4 \ \ u 7 2 7 9 \ \ u 6 0 2 7 \ \ u 4 f 8 b \ \ u 5 9 8 2 \ \ u f f 0 c l a m b d a e x p r e s s i o n s \ \ u 5 4 8 c s t r e a m A P I \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 4 e 3 a \ \ u 4 e 8 6 \ \ u 6 5 b 9 \ \ u 4 f b f \ \ u 8 d 7 7 \ \ u 8 9 c 1 \ \ u f f 0 c \ \ u 5 9 2 7 \ \ u 9 0 e 8 \ \ u 5 2 0 6 \ \ u 6 8 0 7 \ \ u 5 1 c 6 \ \ u 5 e 9 3 \ \ u 7 6 8 4 \ \ u 5 9 3 4 \ \ u 6 5 8 7 \ \ u 4 e f 6 \ \ u 5 d f 2 \ \ u 8 8 a b \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 5 3 0 5 \ \ u 5 4 2 b P a i r \ \ u 7 c 7 b : h t t p s : \ \ / \ \ / d o c s . o r a c l e . c o m \ \ / j a v a s e \ \ / 8 \ \ / j a v a f x \ \ / a p i \ \ / j a v a f x \ \ / u t i l \ \ / P a i r . h t m l < \ \ / p > \ " ] , \ " p y t h o n \ " : [ \ " P y t h o n \ " , \ " < p > \ \ u 7 2 4 8 \ \ u 6 7 2 c \ \ u f f 1 a < c o d e > P y t h o n 2 . 7 . 1 2 < \ \ / c o d e > < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 4 e 3 a \ \ u 4 e 8 6 \ \ u 6 5 b 9 \ \ u 4 f b f \ \ u 8 d 7 7 \ \ u 8 9 c 1 \ \ u f f 0 c \ \ u 5 9 2 7 \ \ u 9 0 e 8 \ \ u 5 2 0 6 \ \ u 5 e 3 8 \ \ u 7 5 2 8 \ \ u 5 e 9 3 \ \ u 5 d f 2 \ \ u 7 e c f \ \ u 8 8 a b \ \ u 8 1 e a \ \ u 5 2 a 8 \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u f f 0 c \ \ u 5 9 8 2 \ \ u f f 1 a < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / d o c s . p y t h o n . o r g \ \ / 2 \ \ / l i b r a r y \ \ / a r r a y . h t m l \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > a r r a y < \ \ / a > , < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / d o c s . p y t h o n . o r g \ \ / 2 \ \ / l i b r a r y \ \ / b i s e c t . h t m l \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > b i s e c t < \ \ / a > , < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / d o c s . p y t h o n . o r g \ \ / 2 \ \ / l i b r a r y \ \ / c o l l e c t i o n s . h t m l \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > c o l l e c t i o n s < \ \ / a > \ \ u 3 0 0 2 \ \ u 5 9 8 2 \ \ u 6 7 9 c \ \ u 6 0 a 8 \ \ u 9 7 0 0 \ \ u 8 9 8 1 \ \ u 4 f 7 f \ \ u 7 5 2 8 \ \ u 5 1 7 6 \ \ u 4 e d 6 \ \ u 5 e 9 3 \ \ u 5 1 f d \ \ u 6 5 7 0 \ \ u f f 0 c \ \ u 8 b f 7 \ \ u 8 1 e a \ \ u 8 8 4 c \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 6 c e 8 \ \ u 6 1 0 f P y t h o n 2 . 7 < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / w w w . p y t h o n . o r g \ \ / d e v \ \ / p e p s \ \ / p e p - 0 3 7 3 \ \ / \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > \ \ u 5 c 0 6 \ \ u 5 7 2 8 2 0 2 0 \ \ u 5 e 7 4 \ \ u 5 4 0 e \ \ u 4 e 0 d \ \ u 5 1 8 d \ \ u 7 e f 4 \ \ u 6 2 a 4 < \ \ / a > \ \ u 3 0 0 2 \ \ u 5 9 8 2 \ \ u 6 0 f 3 \ \ u 4 f 7 f \ \ u 7 5 2 8 \ \ u 6 7 0 0 \ \ u 6 5 b 0 \ \ u 7 2 4 8 \ \ u 7 6 8 4 P y t h o n \ \ u f f 0 c \ \ u 8 b f 7 \ \ u 9 0 0 9 \ \ u 6 2 e 9 P y t h o n 3 \ \ u 3 0 0 2 < \ \ / p > \ " ] , \ " c \ " : [ \ " C \ " , \ " < p > \ \ u 7 2 4 8 \ \ u 6 7 2 c \ \ u f f 1 a < c o d e > G C C 8 . 2 < \ \ / c o d e > \ \ u f f 0 c \ \ u 9 1 c 7 \ \ u 7 5 2 8 G N U 9 9 \ \ u 6 8 0 7 \ \ u 5 1 c 6 \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 7 f 1 6 \ \ u 8 b d 1 \ \ u 6 5 f 6 \ \ u f f 0 c \ \ u 5 c 0 6 \ \ u 4 f 1 a \ \ u 9 1 c 7 \ \ u 7 5 2 8 < c o d e > - O 1 < \ \ / c o d e > \ \ u 7 e a 7 \ \ u 4 f 1 8 \ \ u 5 3 1 6 \ \ u 3 0 0 2 < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / g i t h u b . c o m \ \ / g o o g l e \ \ / s a n i t i z e r s \ \ / w i k i \ \ / A d d r e s s S a n i t i z e r \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > A d d r e s s S a n i t i z e r < \ \ / a > \ \ u 4 e 5 f \ \ u 8 8 a b \ \ u 5 f 0 0 \ \ u 5 4 2 f \ \ u 6 7 6 5 \ \ u 6 8 c 0 \ \ u 6 d 4 b < c o d e > o u t - o f - b o u n d s < \ \ / c o d e > \ \ u 5 4 8 c < c o d e > u s e - a f t e r - f r e e < \ \ / c o d e > \ \ u 9 5 1 9 \ \ u 8 b e f \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 4 e 3 a \ \ u 4 e 8 6 \ \ u 4 f 7 f \ \ u 7 5 2 8 \ \ u 6 5 b 9 \ \ u 4 f b f \ \ u f f 0 c \ \ u 5 9 2 7 \ \ u 9 0 e 8 \ \ u 5 2 0 6 \ \ u 6 8 0 7 \ \ u 5 1 c 6 \ \ u 5 e 9 3 \ \ u 7 6 8 4 \ \ u 5 9 3 4 \ \ u 6 5 8 7 \ \ u 4 e f 6 \ \ u 5 d f 2 \ \ u 7 e c f \ \ u 8 8 a b \ \ u 8 1 e a \ \ u 5 2 a 8 \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u 3 0 0 2 < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > \ \ u 5 9 8 2 \ \ u 6 0 f 3 \ \ u 4 f 7 f \ \ u 7 5 2 8 \ \ u 5 4 c 8 \ \ u 5 e 0 c \ \ u 8 8 6 8 \ \ u 8 f d 0 \ \ u 7 b 9 7 , \ \ u 6 0 a 8 \ \ u 5 3 e f \ \ u 4 e e 5 \ \ u 4 f 7 f \ \ u 7 5 2 8 < a h r e f = \ \ \ " h t t p s : \ \ / \ \ / t r o y d h a n s o n . g i t h u b . i o \ \ / u t h a s h \ \ / \ \ \ " t a r g e t = \ \ \ " _ b l a n k \ \ \ " > u t h a s h < \ \ / a > \ \ u 3 0 0 2 \ \ \ " u t h a s h . h \ \ \ " \ \ u 5 d f 2 \ \ u 7 e c f \ \ u 9 e d 8 \ \ u 8 b a 4 \ \ u 8 8 a b \ \ u 5 b f c \ \ u 5 1 6 5 \ \ u 3 0 0 2 \ \ u 8 b f 7 \ \ u 7 7 0 b \ \ u 5 9 8 2 \ \ u 4 e 0 b \ \ u 7 9 3 a \ \ u 4 f 8 b : < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > < b > 1 . \ \ u 5 f 8 0 \ \ u 5 4 c 8 \ \ u 5 e 0 c \ \ u 8 8 6 8 \ \ u 4 e 2 d \ \ u 6 d f b \ \ u 5 2 a 0 \ \ u 4 e 0 0 \ \ u 4 e 2 a \ \ u 5 b f 9 \ \ u 8 c 6 1 \ \ u f f 1 a < \ \ / b > \ \ r \ \ n < p r e > \ \ r \ \ n s t r u c t h a s h _ e n t r y { \ \ r \ \ n i n t i d ; \ \ / * w e ' l l u s e t h i s f i e l d a s t h e k e y * \ \ / \ \ r \ \ n c h a r n a m e [ 1 0 ] ; \ \ r \ \ n U T _ h a s h _ h a n d l e h h ; \ \ / * m a k e s t h i s s t r u c t u r e h a s h a b l e * \ \ / \ \ r \ \ n } ; \ \ r \ \ n \ \ r \ \ n s t r u c t h a s h _ e n t r y * u s e r s = N U L L ; \ \ r \ \ n \ \ r \ \ n v o i d a d d _ u s e r ( s t r u c t h a s h _ e n t r y * s ) { \ \ r \ \ n H A S H _ A D D _ I N T ( u s e r s , i d , s ) ; \ \ r \ \ n } \ \ r \ \ n < \ \ / p r e > \ \ r \ \ n < \ \ / p > \ \ r \ \ n \ \ r \ \ n < p > < b > 2 . \ \ u 5728 \ \ u 54 c 8 \ \ u 5e0 c \ \ u 8868 \ \ u 4e2 d \ \ u 67e5 \ \ u 627 e \ \ u 4e00 \ \ u 4e2 a \ \ u 5 b f 9 \ \ u 8 c 61 \ \ u f f 1 a < \ \ / b > \ \ r \ \ n < p r e > \ \ r \ \ n s t r u c t h a s h _ e n t r y * f i n d _ u s e r ( i n t u s e r _ i d ) { \ \ r \ \ n s t r u c t h a s h _ e n t r y * s ; \ \ r \ \ n H A S H _ F I N D _ I N T ( u s e r s , & u s e r _ i d , s ) ; \ \ r \ \ n r e
"book" : null ,
"isSubscribed" : false ,
"isDailyQuestion" : false ,
"dailyRecordStatus" : null ,
"editorType" : "CKEDITOR" ,
"ugcQuestionId" : null ,
"style" : "LEETCODE" ,
"exampleTestcases" : "4\n[[0,1,3],[1,2,1],[1,3,4],[2,3,1]]\n4\n5\n[[0,1,2],[0,4,8],[1,2,3],[1,4,2],[2,3,1],[3,4,1]]\n2" ,
"__typename" : "QuestionNode"
}
}
}