[Level 1] 소수 찾기

나며기·2021년 9월 15일
0

programmers

목록 보기
42/111
post-thumbnail
def solution(n):
    tmp = [False,False] + [True]*(n-1)
    for i in range(2,n+1):
        if tmp[i] == True:
            for j in range(2*i,n+1,i):
                tmp[j] = False
    return len([i for i in range(len(tmp)) if tmp[i] == True])
profile
PLUS ULTRA

0개의 댓글