mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
update
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 6211,
|
||||
"dislikes": 9709,
|
||||
"likes": 6227,
|
||||
"dislikes": 9724,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Remove Element\", \"titleSlug\": \"remove-element\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Remove Duplicates from Sorted Array II\", \"titleSlug\": \"remove-duplicates-from-sorted-array-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
||||
"exampleTestcases": "[1,1,2]\n[0,0,1,1,1,2,2,3,3,4]",
|
||||
@@ -131,7 +131,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2M\", \"totalSubmission\": \"4.2M\", \"totalAcceptedRaw\": 2031653, \"totalSubmissionRaw\": 4181896, \"acRate\": \"48.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"2M\", \"totalSubmission\": \"4.2M\", \"totalAcceptedRaw\": 2035502, \"totalSubmissionRaw\": 4188543, \"acRate\": \"48.6%\"}",
|
||||
"hints": [
|
||||
"In this problem, the key point to focus on is the input array being sorted. As far as duplicate elements are concerned, what is their positioning in the array when the given array is sorted? Look at the image above for the answer. If we know the position of one of the elements, do we also know the positioning of all the duplicate elements?\r\n\r\n<br>\r\n<img src=\"https://assets.leetcode.com/uploads/2019/10/20/hint_rem_dup.png\" width=\"500\"/>",
|
||||
"We need to modify the array in-place and the size of the final array would potentially be smaller than the size of the input array. So, we ought to use a two-pointer approach here. One, that would keep track of the current element in the original array and another one for just the unique elements.",
|
||||
|
Reference in New Issue
Block a user