본문 바로가기
728x90

전체 글425

프로그래머스 스쿨 - 달리기 경주(Python)(복습) answer = [] def solution(players, callings): pl = {} for i, j in enumerate(players): pl[j] = i for i in callings: a = pl[i] cur = players[a] pre = players[a-1] pl[cur] -= 1 pl[pre] += 1 players[a] = pre players[a-1] = cur answer = players return answer 2023. 10. 4.
프로그래머스 스쿨 - 공원 산책(Python)(복습) result = [] x = 0 y = 0 def solution(park, routes): for i in range(len(park)): for j in range(len(park[i])): if park[i][j] == 'S': x = j y = i break for route in routes: sx = x sy = y for step in range(int(route[2])): if route[0] == 'E' and sx != len(park[0])-1 and park[sy][sx+1] != 'X': sx += 1 if step == int(route[2])-1: x = sx elif route[0] == 'W' and sx != 0 and park[sy][sx-1] != 'X': sx -= .. 2023. 10. 3.
프로그래머스 스쿨 - 개인정보 수집 유효기간(Python)(복습) today = "2022.05.19" terms = ["A 6", "B 12", "C 3"] privacies = ["2021.05.02 A", "2021.07.01 B", "2022.02.19 C", "2022.02.20 C"] def time_convert(t) : year, month, day = map(int, t.split('.')) return year * 12 * 28 + month * 28 + day # 1달 28일 def solution(today, terms, privacies): term_dict = {} today = time_convert(today) answer = [] for term in terms : name, period = term.split() term_dict[nam.. 2023. 10. 2.
프로그래머스 스쿨 - 최고의 집합(Python) def solution(n, s): answer = [] result = [] if n > s: result.append(-1) else: count1 = s // n for i in range(n): result.append(count1) index = len(result) - 1 for i in range(s % n): result[index] += 1 index -= 1 answer = result return answer result = [] result.append(-1) print(result) 2023. 10. 1.
프로그래머스 스쿨 - 피자 나눠 먹기(3)(Python) def solution(slice, n): answer = ((n-1) // slice) + 1 return answer 2023. 9. 30.
프로그래머스 스쿨 - 피자 나눠 먹기(1)(Python) def solution(n): if n % 7 == 0: answer = (n // 7) else: answer = (n // 7) + 1 return answer #다른 사람 코드 #def solution(n): # return (n - 1) // 7 + 1 // n-1 몫 나누기 7을 해줌으로써 답이나옴 2023. 9. 29.
프로그래머스 스쿨 - 편지(len 공백도 계산함)(Python) def solution(message): answer = len(message) * 2 return answer 2023. 9. 28.
프로그래머스 스쿨 - 특정 문자 제거하기(Python) def solution(my_string, letter): return my_string.replace(letter, '') #다른사람이 한 코드 # def solution(my_string, letter): # answer = '' # for string in my_string: # if string != letter: # answer += string # return answer 2023. 9. 27.
쇼핑정보 및 할인 정보 사이트 모음 1. https://www.ppomppu.co.kr/zboard/view.php?id=ppomppu&page=1&divpage=82&no=486006 [구글 플레이] 무료 200포 코드 NIGHTCROWSZENONIALUNA선착순입니다!! www.ppomppu.co.kr 2. https://coolenjoy.net/bbs/jirum 지름/알뜰정보 페이지 | 쿨엔조이 가격 7,800원 등록자 쾅하고쿵 쪽지보내기 자기소개 아이디로 검색 차단등록 전체게시물 쪽지보내기 자기소개 아이디로 검색 차단등록 전체게시물 등록일 00:00 조회 775 추천 3 가격 9,900원 등록자 coolenjoy.net 3.https://aagag.com/deal/ DEAL :: AA 클리앙-알구게(12) 뽐뿌-뽐뿌(122) 뽐뿌-.. 2023. 9. 27.
728x90