일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |
Tags
- 코딩테스트
- Growth hacking
- 파이썬
- itertools
- coding
- lambda
- sql
- Queue
- time complexity
- Stack
- lv4
- import re
- tableau
- cte
- 코테
- counter
- 코딩
- programmers
- 완전탐색
- 프로그래머스
- AARRR
- level4
- hackerrank
- coding test
- 조합
- LeetCode
- join
- mysql
- python
- Level2
Archives
- Today
- Total
목록prime (1)
ror_coding
[Programmers] 소수 만들기 - 12977
조합 후 소수가 되는 경우 개수길래 set(조합해서 나온 수) 을 해서 중복을 방지했는데 .. 중복 허용인가보다 ㅎㅎ set을 빼니 맞았다. Question 주어진 숫자 중 3개의 수를 더했을 때 소수가 되는 경우의 개수를 구하려고 합니다. 숫자들이 들어있는 배열 nums가 매개변수로 주어질 때, nums에 있는 숫자들 중 서로 다른 3개를 골라 더했을 때 소수가 되는 경우의 개수를 return 하도록 solution 함수를 완성해주세요. Code from itertools import combinations as combdef solution(nums): answer = 0 sums = [sum(c) for c in comb(nums,3)] for n in sums: ..
Coding Test/Python
2024. 10. 12. 12:10