-
[프로그래머스] 기사단원의 무기(Python)Algorithm PS👩🏻💻/프로그래머스 2023. 5. 10. 02:00
문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/136798
코드
def solution(number, limit, power): arms = [] for n in range(1, number + 1): temp = [] for i in range(1, int(n ** 0.5)+1): if n % i == 0: temp.append(i) if i ** 2 != n: temp.append(n//i) arms.append(power if len(temp) > limit else len(temp)) return sum(arms)
'Algorithm PS👩🏻💻 > 프로그래머스' 카테고리의 다른 글
[프로그래머스] 17680번: 캐시(Python, deque) (1) 2024.04.19 [프로그래머스] 두 정수 사이의 합(Python) (0) 2023.05.23 [프로그래머스] 나누어 떨어지는 숫자 배열(Python) (0) 2023.05.23 [프로그래머스] 개인정보 수집 유효기간(Python) (2) 2023.05.10 [프로그래머스] 타켓 넘버(Python) (0) 2023.05.10