[seungbinpark] programmers_더 맵게_Python - #27
Open
seungbinpark wants to merge 1 commit into
Open
Conversation
seungbinpark
requested review from
jaejunmin408,
just-stopyoon,
mingxoxo and
sangkyu39
January 26, 2025 15:08
mingxoxo
approved these changes
Jan 30, 2025
Comment on lines
7
to
8
Member
There was a problem hiding this comment.
이 조건으로 미리 K를 넘기지 못하는 경우와 배열 원소가 2개보다 작을 경우가 한번에 처리되어서 좋은 것 같습니다!
수고하셨습니다 ~~
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 문제 링크
https://school.programmers.co.kr/learn/courses/30/lessons/42626
<섞는 방법>
섞은 음식의 스코빌 지수 = 가장 맵지 않은 음식의 스코빌 지수 + (두 번째로 맵지 않은 음식의 스코빌 지수 * 2)
💡 풀이 아이디어
📝 새로 학습한 내용
heapq 모듈
heapq.heappop(heap): 가장 작은 원소를 힙에서 제거 후 리턴, 비어있는 경우 IndexError
heapq.heapify(x): 리스트 x를 힙 자료형으로 변환
heapq.heappush(heap, item) : item을 heap에 추가
📚 참고 자료