1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
程序员小墨 2022-03-29 15:21:05 +08:00
parent b84ae535b7
commit e730aa6794
2244 changed files with 8703 additions and 59499 deletions

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 4341,
"dislikes": 216,
"likes": 4349,
"dislikes": 217,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Shortest Path to Get Food\", \"titleSlug\": \"shortest-path-to-get-food\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Minimum Operations to Remove Adjacent Ones in Matrix\", \"titleSlug\": \"minimum-operations-to-remove-adjacent-ones-in-matrix\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
"exampleTestcases": "[[0,0,0],[0,1,0],[0,0,0]]\n[[0,0,0],[0,1,0],[1,1,1]]",
@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"226.9K\", \"totalSubmission\": \"519.3K\", \"totalAcceptedRaw\": 226883, \"totalSubmissionRaw\": 519339, \"acRate\": \"43.7%\"}",
"stats": "{\"totalAccepted\": \"227.6K\", \"totalSubmission\": \"520.7K\", \"totalAcceptedRaw\": 227562, \"totalSubmissionRaw\": 520659, \"acRate\": \"43.7%\"}",
"hints": [],
"solution": {
"id": "113",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 658,
"dislikes": 1699,
"likes": 660,
"dislikes": 1700,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Gray Code\", \"titleSlug\": \"gray-code\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "[1,0,0]\n[1,1,1,0]",
@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"102.1K\", \"totalSubmission\": \"220.8K\", \"totalAcceptedRaw\": 102058, \"totalSubmissionRaw\": 220846, \"acRate\": \"46.2%\"}",
"stats": "{\"totalAccepted\": \"102.1K\", \"totalSubmission\": \"221K\", \"totalAcceptedRaw\": 102125, \"totalSubmissionRaw\": 221017, \"acRate\": \"46.2%\"}",
"hints": [
"Keep track of where the next character starts. At the end, you want to know if you started on the last bit."
],

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 3154,
"likes": 3157,
"dislikes": 173,
"isLiked": null,
"similarQuestions": "[]",
@ -161,7 +161,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"105.4K\", \"totalSubmission\": \"341K\", \"totalAcceptedRaw\": 105416, \"totalSubmissionRaw\": 341027, \"acRate\": \"30.9%\"}",
"stats": "{\"totalAccepted\": \"105.5K\", \"totalSubmission\": \"341.4K\", \"totalAcceptedRaw\": 105546, \"totalSubmissionRaw\": 341378, \"acRate\": \"30.9%\"}",
"hints": [],
"solution": {
"id": "189",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 2505,
"likes": 2514,
"dislikes": 157,
"isLiked": null,
"similarQuestions": "[{\"title\": \"4 Keys Keyboard\", \"titleSlug\": \"4-keys-keyboard\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Broken Calculator\", \"titleSlug\": \"broken-calculator\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"97.4K\", \"totalSubmission\": \"186.5K\", \"totalAcceptedRaw\": 97399, \"totalSubmissionRaw\": 186473, \"acRate\": \"52.2%\"}",
"stats": "{\"totalAccepted\": \"97.5K\", \"totalSubmission\": \"186.7K\", \"totalAcceptedRaw\": 97543, \"totalSubmissionRaw\": 186710, \"acRate\": \"52.2%\"}",
"hints": [
"How many characters may be there in the clipboard at the last step if n = 3? n = 7? n = 10? n = 24?"
],

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 1159,
"likes": 1160,
"dislikes": 216,
"isLiked": null,
"similarQuestions": "[]",
@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"62.1K\", \"totalSubmission\": \"127.7K\", \"totalAcceptedRaw\": 62129, \"totalSubmissionRaw\": 127678, \"acRate\": \"48.7%\"}",
"stats": "{\"totalAccepted\": \"62.2K\", \"totalSubmission\": \"127.8K\", \"totalAcceptedRaw\": 62221, \"totalSubmissionRaw\": 127831, \"acRate\": \"48.7%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 5536,
"dislikes": 237,
"likes": 5542,
"dislikes": 238,
"isLiked": null,
"similarQuestions": "[{\"title\": \"3Sum\", \"titleSlug\": \"3sum\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"3Sum Smaller\", \"titleSlug\": \"3sum-smaller\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "[-1,2,1,-4]\n1\n[0,0,0]\n1",
@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"772.1K\", \"totalSubmission\": \"1.6M\", \"totalAcceptedRaw\": 772051, \"totalSubmissionRaw\": 1640391, \"acRate\": \"47.1%\"}",
"stats": "{\"totalAccepted\": \"773.2K\", \"totalSubmission\": \"1.6M\", \"totalAcceptedRaw\": 773194, \"totalSubmissionRaw\": 1642916, \"acRate\": \"47.1%\"}",
"hints": [],
"solution": {
"id": "948",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 892,
"dislikes": 144,
"likes": 895,
"dislikes": 145,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "[1,1,2,2,3,3,4,4,5,5]\n8\n[1,1,2,2,2,2]\n5",
@ -161,7 +161,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"45.4K\", \"totalSubmission\": \"109.7K\", \"totalAcceptedRaw\": 45405, \"totalSubmissionRaw\": 109722, \"acRate\": \"41.4%\"}",
"stats": "{\"totalAccepted\": \"45.4K\", \"totalSubmission\": \"109.8K\", \"totalAcceptedRaw\": 45438, \"totalSubmissionRaw\": 109781, \"acRate\": \"41.4%\"}",
"hints": [],
"solution": {
"id": "587",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 16789,
"dislikes": 1616,
"likes": 16830,
"dislikes": 1620,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Two Sum\", \"titleSlug\": \"two-sum\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"3Sum Closest\", \"titleSlug\": \"3sum-closest\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"4Sum\", \"titleSlug\": \"4sum\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"3Sum Smaller\", \"titleSlug\": \"3sum-smaller\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "[-1,0,1,2,-1,-4]\n[]\n[0]",
@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"1.8M\", \"totalSubmission\": \"6M\", \"totalAcceptedRaw\": 1845626, \"totalSubmissionRaw\": 5983083, \"acRate\": \"30.8%\"}",
"stats": "{\"totalAccepted\": \"1.8M\", \"totalSubmission\": \"6M\", \"totalAcceptedRaw\": 1849340, \"totalSubmissionRaw\": 5992787, \"acRate\": \"30.9%\"}",
"hints": [
"So, we essentially need to find three numbers x, y, and z such that they add up to the given value. If we fix one of the numbers say x, we are left with the two-sum problem at hand!",
"For the two-sum problem, if we fix one of the numbers, say <pre>x</pre>, we have to scan the entire array to find the next number<pre>y</pre> which is <pre>value - x</pre> where value is the input parameter. Can we change our array somehow so that this search becomes faster?",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 3718,
"likes": 3724,
"dislikes": 111,
"isLiked": null,
"similarQuestions": "[{\"title\": \"4Sum\", \"titleSlug\": \"4sum\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"247.3K\", \"totalSubmission\": \"434K\", \"totalAcceptedRaw\": 247298, \"totalSubmissionRaw\": 433982, \"acRate\": \"57.0%\"}",
"stats": "{\"totalAccepted\": \"247.5K\", \"totalSubmission\": \"434.3K\", \"totalAcceptedRaw\": 247536, \"totalSubmissionRaw\": 434341, \"acRate\": \"57.0%\"}",
"hints": [],
"solution": {
"id": "960",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 5852,
"dislikes": 669,
"likes": 5868,
"dislikes": 670,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Two Sum\", \"titleSlug\": \"two-sum\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"3Sum\", \"titleSlug\": \"3sum\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"4Sum II\", \"titleSlug\": \"4sum-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Count Special Quadruplets\", \"titleSlug\": \"count-special-quadruplets\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
"exampleTestcases": "[1,0,-1,0,-2,2]\n0\n[2,2,2,2,2]\n8",
@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"559.9K\", \"totalSubmission\": \"1.5M\", \"totalAcceptedRaw\": 559905, \"totalSubmissionRaw\": 1507075, \"acRate\": \"37.2%\"}",
"stats": "{\"totalAccepted\": \"560.7K\", \"totalSubmission\": \"1.5M\", \"totalAcceptedRaw\": 560703, \"totalSubmissionRaw\": 1508974, \"acRate\": \"37.2%\"}",
"hints": [],
"solution": {
"id": "959",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 1213,
"likes": 1219,
"dislikes": 123,
"isLiked": null,
"similarQuestions": "[{\"title\": \"3Sum\", \"titleSlug\": \"3sum\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"3Sum Closest\", \"titleSlug\": \"3sum-closest\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Valid Triangle Number\", \"titleSlug\": \"valid-triangle-number\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Two Sum Less Than K\", \"titleSlug\": \"two-sum-less-than-k\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"112.6K\", \"totalSubmission\": \"224K\", \"totalAcceptedRaw\": 112617, \"totalSubmissionRaw\": 224048, \"acRate\": \"50.3%\"}",
"stats": "{\"totalAccepted\": \"112.8K\", \"totalSubmission\": \"224.4K\", \"totalAcceptedRaw\": 112767, \"totalSubmissionRaw\": 224382, \"acRate\": \"50.3%\"}",
"hints": [],
"solution": {
"id": "13",

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"21.5K\", \"totalSubmission\": \"39.7K\", \"totalAcceptedRaw\": 21459, \"totalSubmissionRaw\": 39711, \"acRate\": \"54.0%\"}",
"stats": "{\"totalAccepted\": \"21.5K\", \"totalSubmission\": \"39.7K\", \"totalAcceptedRaw\": 21467, \"totalSubmissionRaw\": 39732, \"acRate\": \"54.0%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"3.5K\", \"totalAcceptedRaw\": 2700, \"totalSubmissionRaw\": 3503, \"acRate\": \"77.1%\"}",
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"3.5K\", \"totalAcceptedRaw\": 2716, \"totalSubmissionRaw\": 3525, \"acRate\": \"77.0%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"3.2K\", \"totalAcceptedRaw\": 2695, \"totalSubmissionRaw\": 3170, \"acRate\": \"85.0%\"}",
"stats": "{\"totalAccepted\": \"2.7K\", \"totalSubmission\": \"3.2K\", \"totalAcceptedRaw\": 2715, \"totalSubmissionRaw\": 3191, \"acRate\": \"85.1%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"28.7K\", \"totalSubmission\": \"42.3K\", \"totalAcceptedRaw\": 28694, \"totalSubmissionRaw\": 42287, \"acRate\": \"67.9%\"}",
"stats": "{\"totalAccepted\": \"28.7K\", \"totalSubmission\": \"42.4K\", \"totalAcceptedRaw\": 28745, \"totalSubmissionRaw\": 42375, \"acRate\": \"67.8%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"21.8K\", \"totalSubmission\": \"56.8K\", \"totalAcceptedRaw\": 21791, \"totalSubmissionRaw\": 56755, \"acRate\": \"38.4%\"}",
"stats": "{\"totalAccepted\": \"21.8K\", \"totalSubmission\": \"56.9K\", \"totalAcceptedRaw\": 21844, \"totalSubmissionRaw\": 56881, \"acRate\": \"38.4%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"20.1K\", \"totalSubmission\": \"26.9K\", \"totalAcceptedRaw\": 20069, \"totalSubmissionRaw\": 26929, \"acRate\": \"74.5%\"}",
"stats": "{\"totalAccepted\": \"20.1K\", \"totalSubmission\": \"27K\", \"totalAcceptedRaw\": 20117, \"totalSubmissionRaw\": 26999, \"acRate\": \"74.5%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"8.3K\", \"totalSubmission\": \"13.9K\", \"totalAcceptedRaw\": 8299, \"totalSubmissionRaw\": 13851, \"acRate\": \"59.9%\"}",
"stats": "{\"totalAccepted\": \"8.3K\", \"totalSubmission\": \"13.9K\", \"totalAcceptedRaw\": 8332, \"totalSubmissionRaw\": 13900, \"acRate\": \"59.9%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 891,
"likes": 892,
"dislikes": 147,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Merge Intervals\", \"titleSlug\": \"merge-intervals\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Tag Validator\", \"titleSlug\": \"tag-validator\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"72.6K\", \"totalSubmission\": \"151.3K\", \"totalAcceptedRaw\": 72619, \"totalSubmissionRaw\": 151279, \"acRate\": \"48.0%\"}",
"stats": "{\"totalAccepted\": \"72.8K\", \"totalSubmission\": \"151.6K\", \"totalAcceptedRaw\": 72802, \"totalSubmissionRaw\": 151582, \"acRate\": \"48.0%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"5K\", \"totalSubmission\": \"9.4K\", \"totalAcceptedRaw\": 5040, \"totalSubmissionRaw\": 9362, \"acRate\": \"53.8%\"}",
"stats": "{\"totalAccepted\": \"5.1K\", \"totalSubmission\": \"9.4K\", \"totalAcceptedRaw\": 5069, \"totalSubmissionRaw\": 9421, \"acRate\": \"53.8%\"}",
"hints": [
"Process both linked lists at the same time",
"If the current power of the two heads is equal, add this power with the sum of the coefficients to the answer list.",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 178,
"dislikes": 44,
"dislikes": 45,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"Ads\":[\"ad_id\",\"user_id\",\"action\"]},\"rows\":{\"Ads\":[[1,1,\"Clicked\"],[2,2,\"Clicked\"],[3,3,\"Viewed\"],[5,5,\"Ignored\"],[1,7,\"Ignored\"],[2,7,\"Viewed\"],[3,5,\"Clicked\"],[1,4,\"Viewed\"],[2,11,\"Viewed\"],[1,2,\"Clicked\"]]}}",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"27.3K\", \"totalSubmission\": \"45.5K\", \"totalAcceptedRaw\": 27328, \"totalSubmissionRaw\": 45461, \"acRate\": \"60.1%\"}",
"stats": "{\"totalAccepted\": \"27.4K\", \"totalSubmission\": \"45.6K\", \"totalAcceptedRaw\": 27392, \"totalSubmissionRaw\": 45561, \"acRate\": \"60.1%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 3446,
"likes": 3453,
"dislikes": 706,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Course Schedule II\", \"titleSlug\": \"course-schedule-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -58,7 +58,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"278.8K\", \"totalSubmission\": \"802.1K\", \"totalAcceptedRaw\": 278811, \"totalSubmissionRaw\": 802138, \"acRate\": \"34.8%\"}",
"stats": "{\"totalAccepted\": \"279.3K\", \"totalSubmission\": \"803.3K\", \"totalAcceptedRaw\": 279281, \"totalSubmissionRaw\": 803304, \"acRate\": \"34.8%\"}",
"hints": [],
"solution": {
"id": "923",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 474,
"dislikes": 111,
"likes": 475,
"dislikes": 112,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "3\n[[0,1],[0,2]]\n0\n2\n4\n[[0,1],[0,3],[1,2],[2,1]]\n0\n3\n4\n[[0,1],[0,2],[1,3],[2,3]]\n0\n3",
@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"35.3K\", \"totalSubmission\": \"83.7K\", \"totalAcceptedRaw\": 35272, \"totalSubmissionRaw\": 83715, \"acRate\": \"42.1%\"}",
"stats": "{\"totalAccepted\": \"35.4K\", \"totalSubmission\": \"84K\", \"totalAcceptedRaw\": 35401, \"totalSubmissionRaw\": 83974, \"acRate\": \"42.2%\"}",
"hints": [
"What if we can reach to a cycle from the source node?",
"Then the answer will be false, because we eventually get trapped in the cycle forever.",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 280,
"likes": 281,
"dislikes": 22,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"36.9K\", \"totalSubmission\": \"41.9K\", \"totalAcceptedRaw\": 36859, \"totalSubmissionRaw\": 41865, \"acRate\": \"88.0%\"}",
"stats": "{\"totalAccepted\": \"36.9K\", \"totalSubmission\": \"41.9K\", \"totalAcceptedRaw\": 36922, \"totalSubmissionRaw\": 41932, \"acRate\": \"88.1%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"3.2K\", \"totalSubmission\": \"4.5K\", \"totalAcceptedRaw\": 3233, \"totalSubmissionRaw\": 4506, \"acRate\": \"71.7%\"}",
"stats": "{\"totalAccepted\": \"3.2K\", \"totalSubmission\": \"4.5K\", \"totalAcceptedRaw\": 3249, \"totalSubmissionRaw\": 4526, \"acRate\": \"71.8%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 48,
"likes": 49,
"dislikes": 84,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"12.5K\", \"totalSubmission\": \"14.2K\", \"totalAcceptedRaw\": 12524, \"totalSubmissionRaw\": 14154, \"acRate\": \"88.5%\"}",
"stats": "{\"totalAccepted\": \"12.5K\", \"totalSubmission\": \"14.2K\", \"totalAcceptedRaw\": 12548, \"totalSubmissionRaw\": 14183, \"acRate\": \"88.5%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 51,
"likes": 53,
"dislikes": 7,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Merge Intervals\", \"titleSlug\": \"merge-intervals\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Describe the Painting\", \"titleSlug\": \"describe-the-painting\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Average Height of Buildings in Each Segment\", \"titleSlug\": \"average-height-of-buildings-in-each-segment\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"3.7K\", \"totalAcceptedRaw\": 2269, \"totalSubmissionRaw\": 3744, \"acRate\": \"60.6%\"}",
"stats": "{\"totalAccepted\": \"2.4K\", \"totalSubmission\": \"3.9K\", \"totalAcceptedRaw\": 2364, \"totalSubmissionRaw\": 3910, \"acRate\": \"60.5%\"}",
"hints": [
"Whats a good way to keep track of intervals that you have already painted?",
"Create an array of all 1s, and when you have painted an interval, set the values in that interval to 0.",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 302,
"dislikes": 2606,
"dislikes": 2612,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "[\"joe\",\"joe\",\"joe\",\"james\",\"james\",\"james\",\"james\",\"mary\",\"mary\",\"mary\"]\n[1,2,3,4,5,6,7,8,9,10]\n[\"home\",\"about\",\"career\",\"home\",\"cart\",\"maps\",\"home\",\"home\",\"about\",\"career\"]\n[\"ua\",\"ua\",\"ua\",\"ub\",\"ub\",\"ub\"]\n[1,2,3,4,5,6]\n[\"a\",\"b\",\"a\",\"a\",\"b\",\"c\"]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"59K\", \"totalSubmission\": \"135.7K\", \"totalAcceptedRaw\": 58969, \"totalSubmissionRaw\": 135720, \"acRate\": \"43.4%\"}",
"stats": "{\"totalAccepted\": \"59.3K\", \"totalSubmission\": \"136.2K\", \"totalAcceptedRaw\": 59253, \"totalSubmissionRaw\": 136225, \"acRate\": \"43.5%\"}",
"hints": [
"Let's find for every user separately the websites he visited.",
"Consider all possible 3-sequences, find the number of distinct users who visited each of them.",

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"63K\", \"totalSubmission\": \"123.8K\", \"totalAcceptedRaw\": 63032, \"totalSubmissionRaw\": 123764, \"acRate\": \"50.9%\"}",
"stats": "{\"totalAccepted\": \"63.1K\", \"totalSubmission\": \"123.8K\", \"totalAcceptedRaw\": 63079, \"totalSubmissionRaw\": 123850, \"acRate\": \"50.9%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 126,
"likes": 127,
"dislikes": 17,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"24.5K\", \"totalSubmission\": \"26.8K\", \"totalAcceptedRaw\": 24527, \"totalSubmissionRaw\": 26787, \"acRate\": \"91.6%\"}",
"stats": "{\"totalAccepted\": \"24.6K\", \"totalSubmission\": \"26.9K\", \"totalAcceptedRaw\": 24592, \"totalSubmissionRaw\": 26861, \"acRate\": \"91.6%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"27.5K\", \"totalSubmission\": \"35.1K\", \"totalAcceptedRaw\": 27507, \"totalSubmissionRaw\": 35118, \"acRate\": \"78.3%\"}",
"stats": "{\"totalAccepted\": \"27.5K\", \"totalSubmission\": \"35.1K\", \"totalAcceptedRaw\": 27533, \"totalSubmissionRaw\": 35150, \"acRate\": \"78.3%\"}",
"hints": [
"Check if the given k-digit number equals the sum of the k-th power of it's digits.",
"How to compute the sum of the k-th power of the digits of a number ? Can you divide the number into digits using division and modulus operations ?",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 111,
"likes": 112,
"dislikes": 49,
"isLiked": null,
"similarQuestions": "[]",
@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"9.9K\", \"totalSubmission\": \"19.7K\", \"totalAcceptedRaw\": 9931, \"totalSubmissionRaw\": 19734, \"acRate\": \"50.3%\"}",
"stats": "{\"totalAccepted\": \"9.9K\", \"totalSubmission\": \"19.8K\", \"totalAcceptedRaw\": 9947, \"totalSubmissionRaw\": 19755, \"acRate\": \"50.4%\"}",
"hints": [
"Try to simulate the process.",
"For every iteration, find the new array using the old one and the given rules."

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 80,
"likes": 81,
"dislikes": 25,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"23.7K\", \"totalSubmission\": \"49.6K\", \"totalAcceptedRaw\": 23744, \"totalSubmissionRaw\": 49600, \"acRate\": \"47.9%\"}",
"stats": "{\"totalAccepted\": \"23.8K\", \"totalSubmission\": \"49.7K\", \"totalAcceptedRaw\": 23806, \"totalSubmissionRaw\": 49748, \"acRate\": \"47.9%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"811\", \"totalSubmission\": \"1.4K\", \"totalAcceptedRaw\": 811, \"totalSubmissionRaw\": 1386, \"acRate\": \"58.5%\"}",
"stats": "{\"totalAccepted\": \"811\", \"totalSubmission\": \"1.4K\", \"totalAcceptedRaw\": 811, \"totalSubmissionRaw\": 1387, \"acRate\": \"58.5%\"}",
"hints": [
"Try sorting the start and end points of each building.",
"The naive solution is to go through each position on the street and keep track of the sum of all the buildings at that position and the number of buildings at that position.",

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"25.2K\", \"totalSubmission\": \"44.9K\", \"totalAcceptedRaw\": 25183, \"totalSubmissionRaw\": 44907, \"acRate\": \"56.1%\"}",
"stats": "{\"totalAccepted\": \"25.2K\", \"totalSubmission\": \"45K\", \"totalAcceptedRaw\": 25227, \"totalSubmissionRaw\": 44975, \"acRate\": \"56.1%\"}",
"hints": [],
"solution": {
"id": "169",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 212,
"likes": 214,
"dislikes": 20,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"32.6K\", \"totalSubmission\": \"39.2K\", \"totalAcceptedRaw\": 32640, \"totalSubmissionRaw\": 39155, \"acRate\": \"83.4%\"}",
"stats": "{\"totalAccepted\": \"32.7K\", \"totalSubmission\": \"39.3K\", \"totalAcceptedRaw\": 32741, \"totalSubmissionRaw\": 39261, \"acRate\": \"83.4%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"14.9K\", \"totalSubmission\": \"18.7K\", \"totalAcceptedRaw\": 14920, \"totalSubmissionRaw\": 18693, \"acRate\": \"79.8%\"}",
"stats": "{\"totalAccepted\": \"15K\", \"totalSubmission\": \"18.8K\", \"totalAcceptedRaw\": 14966, \"totalSubmissionRaw\": 18754, \"acRate\": \"79.8%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"10.1K\", \"totalSubmission\": \"19K\", \"totalAcceptedRaw\": 10121, \"totalSubmissionRaw\": 18965, \"acRate\": \"53.4%\"}",
"stats": "{\"totalAccepted\": \"10.1K\", \"totalSubmission\": \"19K\", \"totalAcceptedRaw\": 10149, \"totalSubmissionRaw\": 19007, \"acRate\": \"53.4%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 834,
"likes": 835,
"dislikes": 244,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Basic Calculator\", \"titleSlug\": \"basic-calculator\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Basic Calculator II\", \"titleSlug\": \"basic-calculator-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Basic Calculator IV\", \"titleSlug\": \"basic-calculator-iv\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Build Binary Expression Tree From Infix Expression\", \"titleSlug\": \"build-binary-expression-tree-from-infix-expression\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"81K\", \"totalSubmission\": \"171.3K\", \"totalAcceptedRaw\": 80968, \"totalSubmissionRaw\": 171331, \"acRate\": \"47.3%\"}",
"stats": "{\"totalAccepted\": \"81.2K\", \"totalSubmission\": \"171.7K\", \"totalAcceptedRaw\": 81191, \"totalSubmissionRaw\": 171716, \"acRate\": \"47.3%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"8.9K\", \"totalSubmission\": \"19.8K\", \"totalAcceptedRaw\": 8889, \"totalSubmissionRaw\": 19779, \"acRate\": \"44.9%\"}",
"stats": "{\"totalAccepted\": \"8.9K\", \"totalSubmission\": \"19.8K\", \"totalAcceptedRaw\": 8893, \"totalSubmissionRaw\": 19786, \"acRate\": \"44.9%\"}",
"hints": [
"What if you check every pair of strings (bruteforce)?",
"For every two strings, check if they can form a puzzle by comparing their last and first words."

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"57.2K\", \"totalSubmission\": \"96.3K\", \"totalAcceptedRaw\": 57207, \"totalSubmissionRaw\": 96318, \"acRate\": \"59.4%\"}",
"stats": "{\"totalAccepted\": \"57.3K\", \"totalSubmission\": \"96.4K\", \"totalAcceptedRaw\": 57256, \"totalSubmissionRaw\": 96407, \"acRate\": \"59.4%\"}",
"hints": [
"Try to solve it in one dimension first. How can this solution apply to the two dimension case?"
],

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 116,
"dislikes": 104,
"likes": 115,
"dislikes": 105,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\": {\"MyNumbers\": [\"num\"]}, \"rows\": {\"MyNumbers\": [[8],[8],[3],[3],[1],[4],[5],[6]]}}\n{\"headers\": {\"MyNumbers\": [\"num\"]}, \"rows\": {\"MyNumbers\": [[8],[8],[7],[7],[3],[3],[3]]}}",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"44.1K\", \"totalSubmission\": \"93.2K\", \"totalAcceptedRaw\": 44098, \"totalSubmissionRaw\": 93173, \"acRate\": \"47.3%\"}",
"stats": "{\"totalAccepted\": \"44.2K\", \"totalSubmission\": \"93.3K\", \"totalAcceptedRaw\": 44167, \"totalSubmissionRaw\": 93297, \"acRate\": \"47.3%\"}",
"hints": [],
"solution": {
"id": "188",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 92,
"likes": 93,
"dislikes": 4,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"9.4K\", \"totalSubmission\": \"12K\", \"totalAcceptedRaw\": 9371, \"totalSubmissionRaw\": 11981, \"acRate\": \"78.2%\"}",
"stats": "{\"totalAccepted\": \"9.4K\", \"totalSubmission\": \"12.1K\", \"totalAcceptedRaw\": 9439, \"totalSubmissionRaw\": 12060, \"acRate\": \"78.3%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -58,7 +58,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"6.5K\", \"totalSubmission\": \"9.6K\", \"totalAcceptedRaw\": 6451, \"totalSubmissionRaw\": 9580, \"acRate\": \"67.3%\"}",
"stats": "{\"totalAccepted\": \"6.5K\", \"totalSubmission\": \"9.6K\", \"totalAcceptedRaw\": 6466, \"totalSubmissionRaw\": 9597, \"acRate\": \"67.4%\"}",
"hints": [
"The inorder traversal of a BST gives us the elements in a sorted order.",
"We can use a stack to simulate the inorder traversal of the BST.",

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.1K\", \"totalAcceptedRaw\": 1366, \"totalSubmissionRaw\": 2060, \"acRate\": \"66.3%\"}",
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.1K\", \"totalAcceptedRaw\": 1383, \"totalSubmissionRaw\": 2081, \"acRate\": \"66.5%\"}",
"hints": [
"The target will not be found if it is removed from the sequence. When does this occur?",
"If a pivot is to the left of and is greater than the target, then the target will be removed. The same occurs when the pivot is to the right of and is less than the target.",

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"41.6K\", \"totalSubmission\": \"85.8K\", \"totalAcceptedRaw\": 41640, \"totalSubmissionRaw\": 85791, \"acRate\": \"48.5%\"}",
"stats": "{\"totalAccepted\": \"41.7K\", \"totalSubmission\": \"85.9K\", \"totalAcceptedRaw\": 41673, \"totalSubmissionRaw\": 85865, \"acRate\": \"48.5%\"}",
"hints": [],
"solution": {
"id": "103",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 869,
"likes": 870,
"dislikes": 211,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Longest Consecutive Sequence\", \"titleSlug\": \"longest-consecutive-sequence\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Binary Tree Longest Consecutive Sequence II\", \"titleSlug\": \"binary-tree-longest-consecutive-sequence-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"118.8K\", \"totalSubmission\": \"232.9K\", \"totalAcceptedRaw\": 118751, \"totalSubmissionRaw\": 232890, \"acRate\": \"51.0%\"}",
"stats": "{\"totalAccepted\": \"118.9K\", \"totalSubmission\": \"233K\", \"totalAcceptedRaw\": 118854, \"totalSubmissionRaw\": 233042, \"acRate\": \"51.0%\"}",
"hints": [],
"solution": {
"id": "14",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 110,
"dislikes": 193,
"likes": 111,
"dislikes": 195,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Reverse Linked List\", \"titleSlug\": \"reverse-linked-list\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
"exampleTestcases": "[1,2,3,4,5]\n[]\n[1]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"84.6K\", \"totalSubmission\": \"141K\", \"totalAcceptedRaw\": 84590, \"totalSubmissionRaw\": 141016, \"acRate\": \"60.0%\"}",
"stats": "{\"totalAccepted\": \"84.7K\", \"totalSubmission\": \"141.1K\", \"totalAcceptedRaw\": 84699, \"totalSubmissionRaw\": 141143, \"acRate\": \"60.0%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 2292,
"likes": 2298,
"dislikes": 250,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Binary Tree Level Order Traversal\", \"titleSlug\": \"binary-tree-level-order-traversal\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"254.6K\", \"totalSubmission\": \"499.9K\", \"totalAcceptedRaw\": 254649, \"totalSubmissionRaw\": 499941, \"acRate\": \"50.9%\"}",
"stats": "{\"totalAccepted\": \"255.5K\", \"totalSubmission\": \"501.4K\", \"totalAcceptedRaw\": 255535, \"totalSubmissionRaw\": 501445, \"acRate\": \"51.0%\"}",
"hints": [],
"solution": {
"id": "939",

View File

@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"16.3K\", \"totalSubmission\": \"32.6K\", \"totalAcceptedRaw\": 16321, \"totalSubmissionRaw\": 32601, \"acRate\": \"50.1%\"}",
"stats": "{\"totalAccepted\": \"16.3K\", \"totalSubmission\": \"32.6K\", \"totalAcceptedRaw\": 16337, \"totalSubmissionRaw\": 32623, \"acRate\": \"50.1%\"}",
"hints": [
"First, determine which letters are bold and store that information in mask[i] = if i-th character is bold.\r\nThen, insert the tags at the beginning and end of groups. The start of a group is if and only if (mask[i] and (i == 0 or not mask[i-1])), and the end of a group is similar."
],

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 757,
"likes": 759,
"dislikes": 93,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Minimum Cost Homecoming of a Robot in a Grid\", \"titleSlug\": \"minimum-cost-homecoming-of-a-robot-in-a-grid\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Stamping the Grid\", \"titleSlug\": \"stamping-the-grid\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"64.2K\", \"totalSubmission\": \"128.7K\", \"totalAcceptedRaw\": 64229, \"totalSubmissionRaw\": 128706, \"acRate\": \"49.9%\"}",
"stats": "{\"totalAccepted\": \"64.3K\", \"totalSubmission\": \"128.8K\", \"totalAcceptedRaw\": 64289, \"totalSubmissionRaw\": 128809, \"acRate\": \"49.9%\"}",
"hints": [],
"solution": {
"id": "1047",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 1016,
"dislikes": 1648,
"dislikes": 1655,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Binary Tree Right Side View\", \"titleSlug\": \"binary-tree-right-side-view\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "[1,null,2,3,4]\n[1,2,3,4,5,6,null,null,null,7,8,9,10]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"96.7K\", \"totalSubmission\": \"224.9K\", \"totalAcceptedRaw\": 96657, \"totalSubmissionRaw\": 224922, \"acRate\": \"43.0%\"}",
"stats": "{\"totalAccepted\": \"96.9K\", \"totalSubmission\": \"225.3K\", \"totalAcceptedRaw\": 96868, \"totalSubmissionRaw\": 225337, \"acRate\": \"43.0%\"}",
"hints": [],
"solution": {
"id": "97",

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"37K\", \"totalSubmission\": \"57.3K\", \"totalAcceptedRaw\": 36961, \"totalSubmissionRaw\": 57310, \"acRate\": \"64.5%\"}",
"stats": "{\"totalAccepted\": \"37K\", \"totalSubmission\": \"57.4K\", \"totalAcceptedRaw\": 37013, \"totalSubmissionRaw\": 57382, \"acRate\": \"64.5%\"}",
"hints": [
"All generated strings are of the same size. How can we generate all of these strings?",
"Do a backtracking on which each level of it has to choose one single (e.g. 'a') character or any character of the given parenthesized group (e.g. \"{a,b,c}\")"

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.4K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 2362, \"totalSubmissionRaw\": 3784, \"acRate\": \"62.4%\"}",
"stats": "{\"totalAccepted\": \"2.4K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 2387, \"totalSubmissionRaw\": 3812, \"acRate\": \"62.6%\"}",
"hints": [
"Convert lights into an array of ranges representing the range where each street light can light up and sort the start and end points of the ranges.",
"Do we need to traverse all possible positions on the street?",

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"6.3K\", \"totalSubmission\": \"10.7K\", \"totalAcceptedRaw\": 6340, \"totalSubmissionRaw\": 10652, \"acRate\": \"59.5%\"}",
"stats": "{\"totalAccepted\": \"6.4K\", \"totalSubmission\": \"10.7K\", \"totalAcceptedRaw\": 6384, \"totalSubmissionRaw\": 10719, \"acRate\": \"59.6%\"}",
"hints": [
"Convert infix expression to postfix expression.",
"Build an expression tree from the postfix expression."

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 10,
"dislikes": 13,
"dislikes": 14,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"Terms\":[\"power\",\"factor\"]},\"rows\":{\"Terms\":[[2,1],[1,-4],[0,2]]}}\n{\"headers\":{\"Terms\":[\"power\",\"factor\"]},\"rows\":{\"Terms\":[[4,-4],[2,1],[1,-1]]}}",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"568\", \"totalSubmission\": \"995\", \"totalAcceptedRaw\": 568, \"totalSubmissionRaw\": 995, \"acRate\": \"57.1%\"}",
"stats": "{\"totalAccepted\": \"574\", \"totalSubmission\": \"1K\", \"totalAcceptedRaw\": 574, \"totalSubmissionRaw\": 1013, \"acRate\": \"56.7%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 717,
"dislikes": 98,
"dislikes": 97,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Number of Visible People in a Queue\", \"titleSlug\": \"number-of-visible-people-in-a-queue\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
"exampleTestcases": "[4,2,3,1]\n[4,3,2,1]\n[1,3,2,4]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"94.7K\", \"totalSubmission\": \"118.1K\", \"totalAcceptedRaw\": 94705, \"totalSubmissionRaw\": 118148, \"acRate\": \"80.2%\"}",
"stats": "{\"totalAccepted\": \"95.4K\", \"totalSubmission\": \"119K\", \"totalAcceptedRaw\": 95376, \"totalSubmissionRaw\": 118999, \"acRate\": \"80.1%\"}",
"hints": [
"You can traverse the buildings from the nearest to the ocean to the furthest.",
"Keep with you the maximum to the right while traversing to determine if you can see the ocean or not."

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"14.6K\", \"totalSubmission\": \"17.7K\", \"totalAcceptedRaw\": 14615, \"totalSubmissionRaw\": 17733, \"acRate\": \"82.4%\"}",
"stats": "{\"totalAccepted\": \"14.7K\", \"totalSubmission\": \"17.8K\", \"totalAcceptedRaw\": 14663, \"totalSubmissionRaw\": 17787, \"acRate\": \"82.4%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"37.5K\", \"totalSubmission\": \"68.5K\", \"totalAcceptedRaw\": 37473, \"totalSubmissionRaw\": 68523, \"acRate\": \"54.7%\"}",
"stats": "{\"totalAccepted\": \"37.5K\", \"totalSubmission\": \"68.6K\", \"totalAcceptedRaw\": 37512, \"totalSubmissionRaw\": 68595, \"acRate\": \"54.7%\"}",
"hints": [
"Model the problem with a dp(pos, mask) where pos represents the current bike to be assigned and mask the set of available workers."
],

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"59.8K\", \"totalSubmission\": \"102.8K\", \"totalAcceptedRaw\": 59785, \"totalSubmissionRaw\": 102849, \"acRate\": \"58.1%\"}",
"stats": "{\"totalAccepted\": \"59.9K\", \"totalSubmission\": \"103K\", \"totalAcceptedRaw\": 59860, \"totalSubmissionRaw\": 102971, \"acRate\": \"58.1%\"}",
"hints": [
"<p>Sort the elements by distance. In case of a tie, sort them by the index of the worker. After that, if there are still ties, sort them by the index of the bike.</p>\r\n\r\n<p>Can you do this in less than O(nlogn) time, where n is the total number of pairs between workers and bikes?</p>",
"Loop the sorted elements and match each pair of worker and bike if the given worker and bike where not used."

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 747,
"dislikes": 334,
"likes": 750,
"dislikes": 335,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "[[110,5,112,113,114],[210,211,5,213,214],[310,311,3,313,314],[410,411,412,5,414],[5,1,512,3,3],[610,4,1,613,614],[710,1,2,713,714],[810,1,2,1,1],[1,1,2,2,2],[4,1,4,4,1014]]\n[[1,3,5,5,2],[3,4,3,3,1],[3,2,4,5,2],[2,4,4,5,5],[1,4,4,1,1]]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"48.8K\", \"totalSubmission\": \"65.1K\", \"totalAcceptedRaw\": 48810, \"totalSubmissionRaw\": 65070, \"acRate\": \"75.0%\"}",
"stats": "{\"totalAccepted\": \"48.9K\", \"totalSubmission\": \"65.2K\", \"totalAcceptedRaw\": 48881, \"totalSubmissionRaw\": 65172, \"acRate\": \"75.0%\"}",
"hints": [
"Carefully perform the \"crush\" and \"gravity\" steps. In the crush step, flag each candy that should be removed, then go through and crush each flagged candy. In the gravity step, collect the candy in each column and then rewrite the column appropriately. Do these steps repeatedly until there's no work left to do."
],

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 44,
"dislikes": 108,
"dislikes": 109,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "[3,5,1,6,2,0,8,null,null,7,4]\n7\n[3,5,1,6,2,0,8,null,null,7,4]\n0",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"3.3K\", \"totalAcceptedRaw\": 2269, \"totalSubmissionRaw\": 3337, \"acRate\": \"68.0%\"}",
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"3.3K\", \"totalAcceptedRaw\": 2270, \"totalSubmissionRaw\": 3339, \"acRate\": \"68.0%\"}",
"hints": [
"Start traversing from the leaf. Always go up till you reach the root.",
"Change pointers as asked, make the current node's parent its left child, and make the left child the right one if needed."

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 292,
"likes": 293,
"dislikes": 30,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Majority Element\", \"titleSlug\": \"majority-element\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Majority Element II\", \"titleSlug\": \"majority-element-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"30.8K\", \"totalSubmission\": \"54.4K\", \"totalAcceptedRaw\": 30826, \"totalSubmissionRaw\": 54421, \"acRate\": \"56.6%\"}",
"stats": "{\"totalAccepted\": \"30.9K\", \"totalSubmission\": \"54.5K\", \"totalAcceptedRaw\": 30886, \"totalSubmissionRaw\": 54539, \"acRate\": \"56.6%\"}",
"hints": [
"How to check if a given number target is a majority element?.",
"Find the frequency of target and compare it to the length of the array.",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 143,
"likes": 144,
"dislikes": 9,
"isLiked": null,
"similarQuestions": "[]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"39.3K\", \"totalSubmission\": \"85.9K\", \"totalAcceptedRaw\": 39253, \"totalSubmissionRaw\": 85926, \"acRate\": \"45.7%\"}",
"stats": "{\"totalAccepted\": \"39.3K\", \"totalSubmission\": \"86K\", \"totalAcceptedRaw\": 39283, \"totalSubmissionRaw\": 85975, \"acRate\": \"45.7%\"}",
"hints": [
"Depth-first search (DFS) with the parameters: current node in the binary tree and current position in the array of integers.",
"When reaching at final position check if it is a leaf node."

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.9K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 1945, \"totalSubmissionRaw\": 3776, \"acRate\": \"51.5%\"}",
"stats": "{\"totalAccepted\": \"1.9K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 1950, \"totalSubmissionRaw\": 3805, \"acRate\": \"51.2%\"}",
"hints": [
"Keep looking for 3-equals, if you find a 3-equal, keep going. If you don't find a 3-equal, check if it is a 2-equal.",
"Make sure that it is the only 2-equal.",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 97,
"likes": 98,
"dislikes": 17,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Build Binary Expression Tree From Infix Expression\", \"titleSlug\": \"build-binary-expression-tree-from-infix-expression\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"4.7K\", \"totalSubmission\": \"6.8K\", \"totalAcceptedRaw\": 4713, \"totalSubmissionRaw\": 6806, \"acRate\": \"69.2%\"}",
"stats": "{\"totalAccepted\": \"4.7K\", \"totalSubmission\": \"6.8K\", \"totalAcceptedRaw\": 4724, \"totalSubmissionRaw\": 6824, \"acRate\": \"69.2%\"}",
"hints": [
"Count for each variable how many times it appeared in the first tree.",
"Do the same for the second tree and check if the count is the same for both tree."

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 45,
"likes": 46,
"dislikes": 6,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Checking Existence of Edge Length Limited Paths\", \"titleSlug\": \"checking-existence-of-edge-length-limited-paths\", \"difficulty\": \"Hard\", \"translatedTitle\": null}]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.6K\", \"totalSubmission\": \"3K\", \"totalAcceptedRaw\": 1589, \"totalSubmissionRaw\": 3030, \"acRate\": \"52.4%\"}",
"stats": "{\"totalAccepted\": \"1.6K\", \"totalSubmission\": \"3K\", \"totalAcceptedRaw\": 1591, \"totalSubmissionRaw\": 3033, \"acRate\": \"52.5%\"}",
"hints": [
"Find the minimum spanning tree of the given graph.",
"Root the tree in an arbitrary node and calculate the maximum weight of the edge from each node to the chosen root.",

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"409\", \"totalSubmission\": \"766\", \"totalAcceptedRaw\": 409, \"totalSubmissionRaw\": 766, \"acRate\": \"53.4%\"}",
"stats": "{\"totalAccepted\": \"410\", \"totalSubmission\": \"767\", \"totalAcceptedRaw\": 410, \"totalSubmissionRaw\": 767, \"acRate\": \"53.5%\"}",
"hints": [
"If you know the possible sums you can get for a range [l, r], how can you use this information to calculate the possible sums you can get for a range [l, r + 1]?",
"For the range [l, r], if it is possible to choose elements such that the sum of elements you picked from nums1 is x and the sum of elements you picked from nums2 is y, then (x + nums1[r + 1], y) and (x, y + nums2[r + 1]) are possible sums you can get in the range [l, r + 1].",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 276,
"likes": 278,
"dislikes": 43,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Clone Graph\", \"titleSlug\": \"clone-graph\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Copy List with Random Pointer\", \"titleSlug\": \"copy-list-with-random-pointer\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Clone N-ary Tree\", \"titleSlug\": \"clone-n-ary-tree\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"15.8K\", \"totalSubmission\": \"19.8K\", \"totalAcceptedRaw\": 15830, \"totalSubmissionRaw\": 19825, \"acRate\": \"79.8%\"}",
"stats": "{\"totalAccepted\": \"15.9K\", \"totalSubmission\": \"19.9K\", \"totalAcceptedRaw\": 15866, \"totalSubmissionRaw\": 19873, \"acRate\": \"79.8%\"}",
"hints": [
"Traverse the tree, keep a hashtable with you and create a nodecopy for each node in the tree.",
"Start traversing the original tree again and connect the left, right and random pointers in the cloned tree the same way as the original tree with the help of the hashtable."

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"20.4K\", \"totalSubmission\": \"24.3K\", \"totalAcceptedRaw\": 20384, \"totalSubmissionRaw\": 24335, \"acRate\": \"83.8%\"}",
"stats": "{\"totalAccepted\": \"20.5K\", \"totalSubmission\": \"24.4K\", \"totalAcceptedRaw\": 20469, \"totalSubmissionRaw\": 24430, \"acRate\": \"83.8%\"}",
"hints": [
"Traverse the tree, keep a hashtable with you and create a clone node for each node in the tree.",
"Start traversing the original tree again and connect each child pointer in the cloned tree the same way as the original tree with the help of the hashtable."

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 1017,
"likes": 1018,
"dislikes": 33,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Binary Tree Inorder Traversal\", \"titleSlug\": \"binary-tree-inorder-traversal\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Closest Binary Search Tree Value\", \"titleSlug\": \"closest-binary-search-tree-value\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
@ -64,7 +64,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"93.2K\", \"totalSubmission\": \"164.8K\", \"totalAcceptedRaw\": 93154, \"totalSubmissionRaw\": 164782, \"acRate\": \"56.5%\"}",
"stats": "{\"totalAccepted\": \"93.3K\", \"totalSubmission\": \"165K\", \"totalAcceptedRaw\": 93345, \"totalSubmissionRaw\": 165037, \"acRate\": \"56.6%\"}",
"hints": [
"Consider implement these two helper functions:\r\n<ol type=\"i\"><li><code>getPredecessor(N)</code>, which returns the next smaller node to N.</li>\r\n<li><code>getSuccessor(N)</code>, which returns the next larger node to N.</li>\r\n</ol>",
"Try to assume that each node has a parent pointer, it makes the problem much easier.",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 1385,
"likes": 1386,
"dislikes": 85,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Count Complete Tree Nodes\", \"titleSlug\": \"count-complete-tree-nodes\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Closest Binary Search Tree Value II\", \"titleSlug\": \"closest-binary-search-tree-value-ii\", \"difficulty\": \"Hard\", \"translatedTitle\": null}, {\"title\": \"Search in a Binary Search Tree\", \"titleSlug\": \"search-in-a-binary-search-tree\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"245K\", \"totalSubmission\": \"457.8K\", \"totalAcceptedRaw\": 245016, \"totalSubmissionRaw\": 457785, \"acRate\": \"53.5%\"}",
"stats": "{\"totalAccepted\": \"245.3K\", \"totalSubmission\": \"458.3K\", \"totalAcceptedRaw\": 245320, \"totalSubmissionRaw\": 458287, \"acRate\": \"53.5%\"}",
"hints": [],
"solution": {
"id": "749",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 741,
"likes": 743,
"dislikes": 147,
"isLiked": null,
"similarQuestions": "[]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"37.2K\", \"totalSubmission\": \"81.7K\", \"totalAcceptedRaw\": 37183, \"totalSubmissionRaw\": 81709, \"acRate\": \"45.5%\"}",
"stats": "{\"totalAccepted\": \"37.2K\", \"totalSubmission\": \"81.8K\", \"totalAcceptedRaw\": 37238, \"totalSubmissionRaw\": 81808, \"acRate\": \"45.5%\"}",
"hints": [
"Convert the tree to a general graph, and do a breadth-first search. Alternatively, find the closest leaf for every node on the path from root to target."
],

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"12.3K\", \"totalSubmission\": \"39.5K\", \"totalAcceptedRaw\": 12325, \"totalSubmissionRaw\": 39501, \"acRate\": \"31.2%\"}",
"stats": "{\"totalAccepted\": \"12.3K\", \"totalSubmission\": \"39.5K\", \"totalAcceptedRaw\": 12340, \"totalSubmissionRaw\": 39544, \"acRate\": \"31.2%\"}",
"hints": [],
"solution": {
"id": "228",

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"5.6K\", \"totalSubmission\": \"7.2K\", \"totalAcceptedRaw\": 5616, \"totalSubmissionRaw\": 7248, \"acRate\": \"77.5%\"}",
"stats": "{\"totalAccepted\": \"5.7K\", \"totalSubmission\": \"7.3K\", \"totalAcceptedRaw\": 5663, \"totalSubmissionRaw\": 7303, \"acRate\": \"77.5%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"28.6K\", \"totalSubmission\": \"61.7K\", \"totalAcceptedRaw\": 28636, \"totalSubmissionRaw\": 61709, \"acRate\": \"46.4%\"}",
"stats": "{\"totalAccepted\": \"28.7K\", \"totalSubmission\": \"61.8K\", \"totalAcceptedRaw\": 28666, \"totalSubmissionRaw\": 61755, \"acRate\": \"46.4%\"}",
"hints": [
"Which set of digits have the valid numbers?",
"Only 0, 1, 6, 8, 9 are the valid set of digits, do a backtracking to generate all the numbers containing this digits and check they are valid."

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"24.6K\", \"totalSubmission\": \"53.4K\", \"totalAcceptedRaw\": 24634, \"totalSubmissionRaw\": 53438, \"acRate\": \"46.1%\"}",
"stats": "{\"totalAccepted\": \"24.7K\", \"totalSubmission\": \"53.5K\", \"totalAcceptedRaw\": 24654, \"totalSubmissionRaw\": 53467, \"acRate\": \"46.1%\"}",
"hints": [
"Reverse each digit with their corresponding new digit if an invalid digit is found the return -1. After reversing the digits just compare the reversed number with the original number."
],

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 875,
"likes": 877,
"dislikes": 47,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Minimum Cost to Reach City With Discounts\", \"titleSlug\": \"minimum-cost-to-reach-city-with-discounts\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"54.6K\", \"totalSubmission\": \"89.9K\", \"totalAcceptedRaw\": 54598, \"totalSubmissionRaw\": 89853, \"acRate\": \"60.8%\"}",
"stats": "{\"totalAccepted\": \"54.7K\", \"totalSubmission\": \"90K\", \"totalAcceptedRaw\": 54666, \"totalSubmissionRaw\": 89963, \"acRate\": \"60.8%\"}",
"hints": [
"What if we model the cities as a graph?",
"Build a graph of cities and find the minimum spanning tree.",

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"53.2K\", \"totalSubmission\": \"78.5K\", \"totalAcceptedRaw\": 53210, \"totalSubmissionRaw\": 78491, \"acRate\": \"67.8%\"}",
"stats": "{\"totalAccepted\": \"53.4K\", \"totalSubmission\": \"78.7K\", \"totalAcceptedRaw\": 53352, \"totalSubmissionRaw\": 78688, \"acRate\": \"67.8%\"}",
"hints": [],
"solution": {
"id": "168",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 883,
"likes": 886,
"dislikes": 141,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Construct String from Binary Tree\", \"titleSlug\": \"construct-string-from-binary-tree\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"73.6K\", \"totalSubmission\": \"132.4K\", \"totalAcceptedRaw\": 73619, \"totalSubmissionRaw\": 132379, \"acRate\": \"55.6%\"}",
"stats": "{\"totalAccepted\": \"73.8K\", \"totalSubmission\": \"132.6K\", \"totalAcceptedRaw\": 73803, \"totalSubmissionRaw\": 132641, \"acRate\": \"55.6%\"}",
"hints": [],
"solution": {
"id": "1111",

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 2103,
"dislikes": 170,
"likes": 2108,
"dislikes": 172,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Binary Tree Inorder Traversal\", \"titleSlug\": \"binary-tree-inorder-traversal\", \"difficulty\": \"Easy\", \"translatedTitle\": null}]",
"exampleTestcases": "[4,2,5,1,3]\n[2,1,3]",
@ -64,7 +64,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"200.8K\", \"totalSubmission\": \"312.6K\", \"totalAcceptedRaw\": 200823, \"totalSubmissionRaw\": 312584, \"acRate\": \"64.2%\"}",
"stats": "{\"totalAccepted\": \"201.4K\", \"totalSubmission\": \"313.4K\", \"totalAcceptedRaw\": 201419, \"totalSubmissionRaw\": 313430, \"acRate\": \"64.3%\"}",
"hints": [],
"solution": {
"id": "711",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 27,
"dislikes": 27,
"dislikes": 28,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"Days\":[\"day\"]},\"rows\":{\"Days\":[[\"2022-04-12\"],[\"2021-08-09\"],[\"2020-06-26\"]]}}",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"6.3K\", \"totalSubmission\": \"7.2K\", \"totalAcceptedRaw\": 6288, \"totalSubmissionRaw\": 7168, \"acRate\": \"87.7%\"}",
"stats": "{\"totalAccepted\": \"6.3K\", \"totalSubmission\": \"7.2K\", \"totalAcceptedRaw\": 6316, \"totalSubmissionRaw\": 7198, \"acRate\": \"87.7%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"9.5K\", \"totalSubmission\": \"24.7K\", \"totalAcceptedRaw\": 9458, \"totalSubmissionRaw\": 24737, \"acRate\": \"38.2%\"}",
"stats": "{\"totalAccepted\": \"9.5K\", \"totalSubmission\": \"24.7K\", \"totalAcceptedRaw\": 9459, \"totalSubmissionRaw\": 24738, \"acRate\": \"38.2%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -52,7 +52,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"14K\", \"totalAcceptedRaw\": 10154, \"totalSubmissionRaw\": 13969, \"acRate\": \"72.7%\"}",
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"14K\", \"totalAcceptedRaw\": 10175, \"totalSubmissionRaw\": 13998, \"acRate\": \"72.7%\"}",
"hints": [
"If you traverse the tree from right to left, the invalid node will point to a node that has already been visited."
],

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"8.1K\", \"totalSubmission\": \"10.4K\", \"totalAcceptedRaw\": 8078, \"totalSubmissionRaw\": 10352, \"acRate\": \"78.0%\"}",
"stats": "{\"totalAccepted\": \"8.1K\", \"totalSubmission\": \"10.4K\", \"totalAcceptedRaw\": 8108, \"totalSubmissionRaw\": 10383, \"acRate\": \"78.1%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -46,7 +46,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"4.7K\", \"totalSubmission\": \"6.3K\", \"totalAcceptedRaw\": 4747, \"totalSubmissionRaw\": 6323, \"acRate\": \"75.1%\"}",
"stats": "{\"totalAccepted\": \"4.8K\", \"totalSubmission\": \"6.4K\", \"totalAcceptedRaw\": 4775, \"totalSubmissionRaw\": 6359, \"acRate\": \"75.1%\"}",
"hints": [
"Can we reuse previously calculated information?",
"How can we calculate the sum of the current subtree using the sum of the child's subtree?"

View File

@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.9K\", \"totalSubmission\": \"3.2K\", \"totalAcceptedRaw\": 1854, \"totalSubmissionRaw\": 3216, \"acRate\": \"57.6%\"}",
"stats": "{\"totalAccepted\": \"1.9K\", \"totalSubmission\": \"3.2K\", \"totalAcceptedRaw\": 1862, \"totalSubmissionRaw\": 3230, \"acRate\": \"57.6%\"}",
"hints": [
"We can write it as nums1[i] - nums2[i] > nums2[j] - nums1[j] instead of nums1[i] + nums1[j] > nums2[i] + nums2[j].",
"Store nums1[idx] - nums2[idx] in a data structure.",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 28,
"dislikes": 34,
"dislikes": 35,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "\"abcd\"\n\"bccda\"\n\"ab\"\n\"cd\"",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.2K\", \"totalSubmission\": \"1.9K\", \"totalAcceptedRaw\": 1214, \"totalSubmissionRaw\": 1872, \"acRate\": \"64.9%\"}",
"stats": "{\"totalAccepted\": \"1.2K\", \"totalSubmission\": \"1.9K\", \"totalAcceptedRaw\": 1219, \"totalSubmissionRaw\": 1882, \"acRate\": \"64.8%\"}",
"hints": [
"If the chosen substrings are of size larger than 1, then you can remove all but the first character from both substrings, and you'll get equal substrings of size 1, with the same a but less j. Hence, it's always optimal to choose substrings of size 1.",
"If you choose a specific letter, then it's optimal to choose its first occurrence in firstString, and its last occurrence in secondString, to minimize j-a."

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"4.7K\", \"totalSubmission\": \"7K\", \"totalAcceptedRaw\": 4698, \"totalSubmissionRaw\": 7040, \"acRate\": \"66.7%\"}",
"stats": "{\"totalAccepted\": \"4.7K\", \"totalSubmission\": \"7.1K\", \"totalAcceptedRaw\": 4728, \"totalSubmissionRaw\": 7078, \"acRate\": \"66.8%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 180,
"likes": 181,
"dislikes": 30,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"42.8K\", \"totalSubmission\": \"76.1K\", \"totalAcceptedRaw\": 42828, \"totalSubmissionRaw\": 76062, \"acRate\": \"56.3%\"}",
"stats": "{\"totalAccepted\": \"42.9K\", \"totalSubmission\": \"76.2K\", \"totalAcceptedRaw\": 42936, \"totalSubmissionRaw\": 76208, \"acRate\": \"56.3%\"}",
"hints": [
"Still remember the difference between 'INNER JOIN' and 'OUTTER JOIN' in SQL?",
"Do you know other expressions using the 'COUNT' function besides 'COUNT(*)'?"

View File

@ -64,7 +64,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.6K\", \"totalAcceptedRaw\": 1394, \"totalSubmissionRaw\": 2617, \"acRate\": \"53.3%\"}",
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.6K\", \"totalAcceptedRaw\": 1401, \"totalSubmissionRaw\": 2636, \"acRate\": \"53.1%\"}",
"hints": [
"Change the zeros in nums to -1 and create a prefix sum array prefixSum using the new nums.",
"If prefixSum[i] for any index i in the range 0 <= i < prefixSum.length is positive, that means that there are more ones than zeros in the prefix ending at index i.",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Easy",
"likes": 264,
"likes": 265,
"dislikes": 43,
"isLiked": null,
"similarQuestions": "[]",
@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"20.3K\", \"totalSubmission\": \"25.8K\", \"totalAcceptedRaw\": 20344, \"totalSubmissionRaw\": 25817, \"acRate\": \"78.8%\"}",
"stats": "{\"totalAccepted\": \"20.4K\", \"totalSubmission\": \"25.8K\", \"totalAcceptedRaw\": 20361, \"totalSubmissionRaw\": 25843, \"acRate\": \"78.8%\"}",
"hints": [
"What if we divide the string into substrings containing only one distinct character with maximal lengths?",
"Now that you have sub-strings with only one distinct character, Try to come up with a formula that counts the number of its sub-strings.",

View File

@ -12,7 +12,7 @@
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 7,
"dislikes": 77,
"dislikes": 78,
"isLiked": null,
"similarQuestions": "[]",
"exampleTestcases": "{\"headers\":{\"Experiments\":[\"experiment_id\",\"platform\",\"experiment_name\"]},\"rows\":{\"Experiments\":[[4,\"IOS\",\"Programming\"],[13,\"IOS\",\"Sports\"],[14,\"Android\",\"Reading\"],[8,\"Web\",\"Reading\"],[12,\"Web\",\"Reading\"],[18,\"Web\",\"Programming\"]]}}",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"4.5K\", \"totalAcceptedRaw\": 2278, \"totalSubmissionRaw\": 4514, \"acRate\": \"50.5%\"}",
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"4.5K\", \"totalAcceptedRaw\": 2292, \"totalSubmissionRaw\": 4533, \"acRate\": \"50.6%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Medium",
"likes": 918,
"dislikes": 292,
"likes": 922,
"dislikes": 294,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Subtree of Another Tree\", \"titleSlug\": \"subtree-of-another-tree\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Longest Univalue Path\", \"titleSlug\": \"longest-univalue-path\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "[5,1,5,5,5,null,5]\n[]\n[5,5,5,5,5,null,5]",
@ -40,7 +40,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"116K\", \"totalSubmission\": \"212.1K\", \"totalAcceptedRaw\": 116021, \"totalSubmissionRaw\": 212051, \"acRate\": \"54.7%\"}",
"stats": "{\"totalAccepted\": \"116.2K\", \"totalSubmission\": \"212.4K\", \"totalAcceptedRaw\": 116230, \"totalSubmissionRaw\": 212387, \"acRate\": \"54.7%\"}",
"hints": [],
"solution": {
"id": "703",

View File

@ -11,7 +11,7 @@
"translatedContent": null,
"isPaidOnly": true,
"difficulty": "Hard",
"likes": 40,
"likes": 41,
"dislikes": 5,
"isLiked": null,
"similarQuestions": "[]",
@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.3K\", \"totalAcceptedRaw\": 1397, \"totalSubmissionRaw\": 2319, \"acRate\": \"60.2%\"}",
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"2.3K\", \"totalAcceptedRaw\": 1399, \"totalSubmissionRaw\": 2321, \"acRate\": \"60.3%\"}",
"hints": [
"Try to define a recursive approach. For the ith candies, there will be one of the two following cases:",
"If the i - 1 previous candies are already distributed into k bags for the ith candy, you can have k * dp[n - 1][k] ways to distribute the ith candy. We need then to solve the state of (n - 1, k).",

View File

@ -34,7 +34,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"89.5K\", \"totalSubmission\": \"150.4K\", \"totalAcceptedRaw\": 89461, \"totalSubmissionRaw\": 150446, \"acRate\": \"59.5%\"}",
"stats": "{\"totalAccepted\": \"89.5K\", \"totalSubmission\": \"150.5K\", \"totalAcceptedRaw\": 89480, \"totalSubmissionRaw\": 150471, \"acRate\": \"59.5%\"}",
"hints": [
"Use hashset to store all elements.",
"Loop again to count all valid elements."

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"15.3K\", \"totalSubmission\": \"26.4K\", \"totalAcceptedRaw\": 15345, \"totalSubmissionRaw\": 26423, \"acRate\": \"58.1%\"}",
"stats": "{\"totalAccepted\": \"15.4K\", \"totalSubmission\": \"26.6K\", \"totalAcceptedRaw\": 15419, \"totalSubmissionRaw\": 26567, \"acRate\": \"58.0%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"15.3K\", \"totalSubmission\": \"19.6K\", \"totalAcceptedRaw\": 15346, \"totalSubmissionRaw\": 19589, \"acRate\": \"78.3%\"}",
"stats": "{\"totalAccepted\": \"15.4K\", \"totalSubmission\": \"19.6K\", \"totalAcceptedRaw\": 15376, \"totalSubmissionRaw\": 19623, \"acRate\": \"78.4%\"}",
"hints": [],
"solution": null,
"status": null,

View File

@ -28,7 +28,7 @@
],
"companyTagStats": null,
"codeSnippets": null,
"stats": "{\"totalAccepted\": \"26.4K\", \"totalSubmission\": \"35.9K\", \"totalAcceptedRaw\": 26382, \"totalSubmissionRaw\": 35901, \"acRate\": \"73.5%\"}",
"stats": "{\"totalAccepted\": \"26.5K\", \"totalSubmission\": \"36K\", \"totalAcceptedRaw\": 26469, \"totalSubmissionRaw\": 36010, \"acRate\": \"73.5%\"}",
"hints": [],
"solution": null,
"status": null,

Some files were not shown because too many files have changed in this diff Show More