Created
May 10, 2025 16:50
-
-
Save ssokolowskisebastian/ec8b707c8af4d0c90a5339b27afa86b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
start_time = time.time() | |
def get_primes(n): | |
for i in range(2, n): | |
for j in range(2, int(i**0.5)+1): | |
if i % j == 0: | |
break | |
else: | |
yield i | |
def solution(n): | |
for i, j in enumerate(get_primes(100*n)): | |
if i == n: | |
return j | |
print(solution(10000)) | |
print("--- %s seconds ---" % (time.time() - start_time)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment