Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- dacon
- SW Expert Academy
- programmers
- 우분투
- 프로그래머스
- Real or Not? NLP with Disaster Tweets
- 편스토랑 우승상품
- 편스토랑
- 프로그래머스 파이썬
- Git
- 맥북
- 파이썬
- 금융문자분석경진대회
- 자연어처리
- 데이콘
- PYTHON
- Baekjoon
- 코로나19
- 더현대서울 맛집
- 백준
- Kaggle
- leetcode
- AI 경진대회
- gs25
- Docker
- ChatGPT
- github
- ubuntu
- 캐치카페
- hackerrank
Archives
- Today
- Total
목록
반응형
Count Primes (1)
반응형
솜씨좋은장씨
[leetCode] 204. Count Primes (Python)
Count the number of prime numbers less than a non-negative number, n. Example: Input: 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. Solution class Solution: def getPrimaryNum_Eratos(N): nums = [True] * (N + 1) for i in range(2, len(nums) // 2 + 1): if nums[i] == True: for j in range(i+i, N, i): nums[j] = False return [i for i in range(2, N) if nums[i] == ..
Programming/코딩 1일 1문제
2020. 6. 6. 23:34
반응형