1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 15:01:40 +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": "Medium",
"likes": 4623,
"dislikes": 976,
"likes": 4720,
"dislikes": 988,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Ugly Number\", \"titleSlug\": \"ugly-number\", \"difficulty\": \"Easy\", \"translatedTitle\": null}, {\"title\": \"Ugly Number II\", \"titleSlug\": \"ugly-number-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Perfect Squares\", \"titleSlug\": \"perfect-squares\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
"exampleTestcases": "10\n0\n1",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"595.2K\", \"totalSubmission\": \"1.8M\", \"totalAcceptedRaw\": 595158, \"totalSubmissionRaw\": 1804736, \"acRate\": \"33.0%\"}",
"stats": "{\"totalAccepted\": \"602.3K\", \"totalSubmission\": \"1.8M\", \"totalAcceptedRaw\": 602265, \"totalSubmissionRaw\": 1825249, \"acRate\": \"33.0%\"}",
"hints": [
"<p>Let's start with a <i>isPrime</i> function. To determine if a number is prime, we need to check if it is not divisible by any number less than <i>n</i>. The runtime complexity of <i>isPrime</i> function would be O(<i>n</i>) and hence counting the total prime numbers up to <i>n</i> would be O(<i>n</i><sup>2</sup>). Could we do better?</p>",
"<p>As we know the number must not be divisible by any number > <i>n</i> / 2, we can immediately cut the total iterations half by dividing only up to <i>n</i> / 2. Could we still do better?</p>",