[LeetCode]Count Primes
发布日期:2021-11-22 02:48:51 浏览次数:3 分类:技术文章

本文共 270 字,大约阅读时间需要 1 分钟。

Description:

Count the number of prime numbers less than a non-negative number, n.

Credits:

Special thanks to  for adding this problem and creating all test cases.

题解:使用的是筛选法。

public int countPrimes(int n) {		boolean[] flag = new boolean[n];		int count=0;		for(int i=2; i

转载地址:https://blog.csdn.net/zxdfc/article/details/48706759 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:[LeetCode]First Bad Version
下一篇:[LeetCode]Palindrome Linked List

发表评论

最新留言

留言是一种美德,欢迎回访!
[***.207.175.100]2024年04月17日 12时27分27秒