[파이썬] 프로그래머스 : 프렌즈 4블록 (레벨2)
[파이썬] 프로그래머스 : 프렌즈 4블록 (레벨2)프로그래머스 : 프렌즈 4블록 (레벨2)풀이방향성 생각아래로 떨어지는거 구현하기 불편해서 transpose + 각 row에서 reversed 시켜서 풀이 pythondef solution(m, n, board): # 2x2 박스 체크 def check(x,y): temp = set(arr[yy][xx] for xx,yy in [(x,y),(x+1,y),(x,y+1),(x+1,y+1)]) return len(temp) == 1 and '#' not in temp # 2x2 박스 제거 def remove(x,y): for xx,yy in [(x,y),(x+1,y),(x,y+1),(x+1,y+1)]: ..
2025. 3. 22.