일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- BFS
- mysql
- Level2
- 코딩
- 조합
- 시간복잡도
- 파이썬
- join
- coding test
- cte
- 데이터분석
- coding
- lambda
- 코딩테스트
- Queue
- collections
- 완전탐색
- 코테
- import re
- counter
- Stack
- 연습문제
- time complexity
- sql
- programmers
- itertools
- 프로그래머스
- python
- level4
- lv4
- Today
- Total
목록list comprehension (1)
ror_coding
[Programmers] 약수의 합 - 12928
sqrt()로 for문 연산 줄이는 코드 , List comprehension 코드 둘 다 기록하기!sqrt() 연산시 제곱 수 중복 때문에 (ex. 16 = 4x4) list에 약수를 저장 후 set() 해줘야 한다! Question 정수 n을 입력받아 n의 약수를 모두 더한 값을 리턴하는 함수, solution을 완성해주세요. Point Basic for문 : Code 1List comprehension : Code 2math.sqrt() 로 for문 연산 줄이기 : Code 3set() Code 3번 제곱의 약수 중복 방지 Code 1 : Basic def solution(n): sum=0 for i in range(1,n+1): sum += i if n%i == 0 el..
Algorithm/Python
2024. 9. 28. 15:01