Merged
Conversation
zaqquum
approved these changes
Jun 1, 2025
Collaborator
zaqquum
left a comment
There was a problem hiding this comment.
부트캠프 시작하셨군요! 바쁘신 와중에 문제 푸시느라 지난 주 고생하셨습니다. 이번 주도 화이팅입니다:)
Collaborator
There was a problem hiding this comment.
중간에 있는 빈공간(.) 을 for문으로 바로 윗 칸의 내용과 swap 하여 빈공간을 점점 위로 올리는 식으로 동작하는 것이 인상적이였습니다.
저는 아래 부터 stack으로 뿌요뿌요만 축척한 후 다시 아래부터 재배치하는 식으로 구현했는데 다른 알고리즘으로 동작 할 수 있네요
def refine_field(x) : # 중간 빈자리
stack = deque()
#1.아레=> 위로 스택에 뿌요뿌요 순서대로 축척하기
for ny in range(11, -1,-1):
if field[ny][x] != ".":
stack.append(field[ny][x])
for ny in range(11, -1, -1) :
if stack :
field[ny][x] = stack.popleft()
else :
field[ny][x] = "."
🔥2025-05 챌린지 진행 상황👉 그래프
👉 구현
|
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.
🌱WIL
BFS+구현문제를 풀었고, 다른 문제로는 java로 힙 유형 문제를 풀이해보았다. BFS 구현 문제의 경우, 큰 틀은 다 동일한 것 같다. 다만 방향이라거나, 맵이 이동한다거나 추가적인 조건을 다루는 것이 어려운 부분인 것 같다.#16509 장군 문제도 방향이 8가지나 되어 이동하는 걸 고려하는 것이 가장 헷갈렸던 부분이었다.#11559. Puyo Puyo는 중력을 처리하는 부분이 막막했다. Puyo가 터지게 되면 밑으로 내려오도로 하기 위해서 반복적으로 교환하며 풀이하는 부분이 인상적이었다. 나의 경우, 이 부분에서 막혀서 다른 분들의 정답을 보고 풀이를 이어가게 되었다.프로그래머스 고득점 kit - 더 맵게문제의 경우, Java에서Heap을 구현하기 위해서는PriorityQueue를 사용하면 된다는 것을 알게 되었다.🚀주간 목표 문제 수: 3개
백준 #16509. 장군: 그래프 / 골드5
정리한 링크: (바로가기)
🚩플로우 (선택)
🚩제출한 코드
💡TIL
백준 #11559. Puyo Puyo: 그래프 / 골드4
정리한 링크: (바로가기)
🚩플로우 (선택)
visited배열을 초기화한다.pang = True로 설정한다.pang이 참이면 블록을 아래로 내리고combo += 1🚩제출한 코드
💡TIL
down()함수에서 위에서 아래로 내려오도록 반복적으로 교환하는 방식이 인상 깊었다.프로그래머스 #42626. 더맵게: 힙 / Level2
정리한 링크: (바로가기)
🚩플로우 (선택)
while문을 통해:1반환.🚩제출한 코드
💡TIL
deque를 이용하여 쉽게 구현할 수 있던 부분을 Java로 접근하니 어떤 프레임워크를 써야 할 지 감이 오지 않았다.Java Heap이라고 검색하니 “PriorityQueue” 컬렉션이 나오게 되었다. 이 자료구조를 활용하여 풀이하니 쉽게 접근할 수 있었다.PriorityQueue자료형에서 사용하는 요소는offer,peek,poll이 있다.PriorityQueue를 써야만 하는 유형이었다.