3 kyu
Prime counting
Description:
You need to count the number of prime numbers less than or equal to some natural n
.
For example:
count_primes_less_than(34) = 11
count_primes_less_than(69) = 19
count_primes_less_than(420) = 81
count_primes_less_than(666) = 121
- In this kata all the tests will be with
- Code length limited to
3000
characters to avoid hardcoding.
Good luck!
Mathematics
Recursion
Algorithms
Memoization
Performance
Number Theory
Similar Kata:
Stats:
Created | Dec 4, 2022 |
Published | Dec 4, 2022 |
Warriors Trained | 2071 |
Total Skips | 174 |
Total Code Submissions | 3696 |
Total Times Completed | 80 |
Python Completions | 80 |
Total Stars | 112 |
% of votes with a positive feedback rating | 82% of 22 |
Total "Very Satisfied" Votes | 16 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 2 |
Total Rank Assessments | 7 |
Average Assessed Rank | 3 kyu |
Highest Assessed Rank | 2 kyu |
Lowest Assessed Rank | 3 kyu |