LeetCode204——計數質數

我的LeetCode代碼倉:https://github.com/617076674/LeetCode 原題鏈接:https://leetcode-cn.com/problems/count-primes/description/ 題目描述: 知識點:素數 思路一:挨個判斷[2, n - 1]範圍內的數是否是素數 時間複雜度是O(n ^ 1.5)。空間複雜度是O(1)。 JAVA代碼: class
相關文章
相關標籤/搜索