본문 바로가기

Algorithm37

스택/큐 - 기능개발 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/42586 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr  def solution(progresses, speeds): answer = [] time = [] l = len(progresses) for i in range(l): p, s = progresses[i], speeds[i] if (100 - p) % s == 0: time.append((100 - p) // s ) else: time.app.. 2025. 1. 16.
스택/큐 - 같은 숫자는 싫어 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/12906 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(arr): answer = [] c = -1 for i in arr: if len(answer) ==0 : answer.append(i) c = i else: if c == i: pass else: answer.append(i) .. 2025. 1. 16.
★★★ 해시 - 베스트앨범 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/42579 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr  def solution(genres, plays): x = len(genres) dict_music = {} dict_list = {} answer = [] for i in range(x): gen = genres[i] if gen not in dict_music.keys(): dict_music[gen] = plays[i] dict_list[gen] .. 2025. 1. 15.
해시 - 의상 (프로그래머스) https://school.programmers.co.kr/learn/courses/30/lessons/42578?language=python3 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr def solution(clothes): dict_cloth = {} answer = 1 for cloth, types in clothes: if types not in dict_cloth.keys(): dict_cloth[types] = [cloth] else: dict_cloth[types].append(cloth) for i.. 2025. 1. 15.