Skip to content

Conversation

@gkelley
Copy link

@gkelley gkelley commented Oct 9, 2022

Pull Request Template

Description

Given an integer n, return the number of prime numbers that are strictly less than n.

Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 

No dependencies.

Solution:

  • Assume every number is prime and create an array of all the numbers up to n. Loop through all numbers up to n and when you find a prime, set all the multiples of that number to not prime.

Put check marks:

  • Added problem & solution under correct topic.
  • Specified Space & Time complexity.
  • Specified difficulty level, tag & Note(if any).

How Has This Been Tested?

  • Tested via Leetcode solver

Make sure all below guidelines are followed else PR will get Reject:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code so that it is easy to understand
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
@welcome
Copy link

welcome bot commented Oct 9, 2022

I can tell this is your first pull request! Thank you I'm so honored. 🎉🎉🎉 I'll take a look at it ASAP!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant