1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 15:31:43 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -11,8 +11,8 @@
"translatedContent": null,
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 6227,
"dislikes": 9724,
"likes": 6432,
"dislikes": 9970,
"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\": 2035502, \"totalSubmissionRaw\": 4188543, \"acRate\": \"48.6%\"}",
"stats": "{\"totalAccepted\": \"2.1M\", \"totalSubmission\": \"4.3M\", \"totalAcceptedRaw\": 2086370, \"totalSubmissionRaw\": 4274405, \"acRate\": \"48.8%\"}",
"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.",