mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
Remove leetcode Count Primes (204.c)
This commit is contained in:
parent
2ec2f92284
commit
7c0e52f794
@ -40,7 +40,6 @@ LeetCode
|
||||
|190|[Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [C](./src/190.c)|Easy|
|
||||
|191|[Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/) | [C](./src/191.c)|Easy|
|
||||
|203|[Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/) | [C](./src/203.c)|Easy|
|
||||
|204|[Count Primes](https://leetcode.com/problems/count-primes) | [C](./src/204.c)|Easy|
|
||||
|206|[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [C](./src/206.c)|Easy|
|
||||
|215|[Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [C](./src/215.c)|Medium|
|
||||
|217|[Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [C](./src/217.c)|Easy|
|
||||
|
@ -1,16 +0,0 @@
|
||||
int countPrimes(int n){
|
||||
int count = 0;
|
||||
int isPrime;
|
||||
for (int i = 2; i <= n; i++){
|
||||
isPrime = 1;
|
||||
for(int j = 2; j < i; j++){
|
||||
if(i % j == 0){
|
||||
isPrime = 0;
|
||||
}
|
||||
}
|
||||
if(isPrime == 1){
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
Loading…
Reference in New Issue
Block a user