Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyangshuyogi committed Dec 29, 2017
1 parent 73ace60 commit 62a3c5d
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ Examples of first few prime numbers are {2, 3, 5, 7,...}

Examples:

Input: n = 11
**Input:** n = 11

Output: true
**Output:** true

Input: n = 15
**Input:** n = 15

Output: false
**Output:** false

Input: n = 1
**Input:** n = 1

Output: false
**Output:** false

A simple solution is to iterate through all numbers from 2 to n-1 and for every number check if it divides n. If we find
any number that divides, we return false. Instead of checking till n, we can check till √n because a larger factor of n
Expand Down

0 comments on commit 62a3c5d

Please sign in to comment.