본문 바로가기

프로그래머스/Lv.149

2025 프로그래머스 코드챌린지 1차 예선 > 유연근무제 - Python, 구현 https://school.programmers.co.kr/learn/courses/30/lessons/388351 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr  코드 & 풀이 def solution(schedules, timelogs, startday): answer = 0 new_schedules = [] for schedule in schedules: hour = schedule // 100 minute = schedule % 100 minute = (minute + 10) % 60 hour += (schedule % 10.. 2025. 2. 12.
2024 KAKAO WINTER INTERNSHIP > 가장 많이 받은 선물 - Python, 구현 https://school.programmers.co.kr/learn/courses/30/lessons/258712?language=python3 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 def solution(friends, gifts): size = len(friends) friends_idx = {name:i for i, name in enumerate(friends)} history = [[0] * size for _ in range(size)] gift_sub = [0] * size result = [0] * size for gift in gi.. 2024. 12. 8.
PCCP 기출문제 > 붕대 감기 - Pyton, 구현 https://school.programmers.co.kr/learn/courses/30/lessons/250137 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 & 풀이 def solution(bandage, health, attacks): max_health = health bonus_standard, heal_per_sec, bonus_heal = bandage for i in range(len(attacks)): if i == 0: health -= attacks[i][1] else: gap = attacks[.. 2024. 12. 8.
2021 KAKAO BLIND RECRUITMENT > 신규 아이디 추천 - Python, 정규표현식 https://school.programmers.co.kr/learn/courses/30/lessons/72410 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 import redef solution(new_id): new_id = re.sub(r'[^a-z0-9_.-]', '', new_id.lower()) new_id = re.sub(r'\.{2,}', '.', new_id).strip('.') new_id = "aaa" if not new_id else new_id[:15].rstrip('.') return new_id.ljust(3, new_id[-1])  정규표현식을.. 2024. 12. 7.
PCCE 기출문제 > 데이터 분석 - Pyton, sorted, lambda https://school.programmers.co.kr/learn/courses/30/lessons/250121 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드 def solution(data, ext, val_ext, sort_by): compiles = {"code" : 0, "date" : 1, "maximum" : 2, "remain" : 3} ext_index = compiles[ext] sort_index = compiles[sort_by] filtered_data = [row for row in data if row[ext_index]   줄이려면 한 줄.. 2024. 12. 7.
2018 KAKAO BLIND RECRUITMENT > 다트 게임 - Pyton, re, compile, findall, 정규식 https://school.programmers.co.kr/learn/courses/30/lessons/17682 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 코드def solution(dartResult): num = "" score = [] bonus = {"S":1, "D":2, "T":3} for round in dartResult: if round.isdigit(): num += round elif round in bonus: score.append(int(num) ** bonus[round].. 2024. 12. 6.