알쓸코지
article thumbnail
[Lv.0/Python] 편지
Algorithm/프로그래머스 2023. 7. 27. 13:32

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/120898 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 💻 Code def solution(message): return len(message) * 2

article thumbnail
[Lv.0/Python] 피자 나눠 먹기 (3)
Algorithm/프로그래머스 2023. 7. 27. 13:31

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/120816 💻 Code from math import ceil def solution(slice, n): return ceil(n / slice)

article thumbnail
[Lv.0/Python] 피자 나눠 먹기 (1)
Algorithm/프로그래머스 2023. 7. 27. 13:28

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/120814 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 💻 Code from math import ceil def solution(n): return ceil(n / 7)

article thumbnail
[Lv.0/Python] 양꼬치
Algorithm/프로그래머스 2023. 7. 27. 13:18

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/120830 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 💻 Code def solution(n, k): return 12000 * n + 2000 * (k - n // 10)

article thumbnail
[Lv.0/Python] 배열의 평균값
Algorithm/프로그래머스 2023. 7. 27. 13:16

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/120817 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 💻 Code def solution(numbers): return sum(numbers) / len(numbers)

article thumbnail
[Lv.0/Python] 주사위 게임1
Algorithm/프로그래머스 2023. 7. 26. 23:15

🔗 문제 https://school.programmers.co.kr/learn/courses/30/lessons/181839 💻 Code def solution(a, b): score = 0 if a % 2 == 1 and b % 2 == 1: score += a ** 2 + b ** 2 elif a % 2 == 1 or b % 2 == 1: score += 2 * (a + b) elif a % 2 == 0 and b % 2 == 0: score += abs(a - b) return score