[백준 4963] 섬의개수 - Python
이번 백준 4963번은 대각선도 고려해줘야 한다는 점에서 많이 어려웠다... bfs 공부한지 이제 주말빼고 3일정도 지났는데 이제야 슬슬 감이 오기 시작 ㅎㅎ 이전에 풀었던 문제들도 곧 올릴 예정 !! 😊 from collections import deque def bfs(x,y): queue = deque() queue.append((x,y)) #대각선 확인 direction = [(1,0),(-1,0),(0,1),(0,-1),(1,1),(1,-1),(-1,1),(-1,-1)] while queue: current_x, current_y= queue.popleft() for i in range(8): dx = current_x + direction[i][0] dy = current_y + directi..