[문제 링크] 👉 https://www.acmicpc.net/problem/1303풀이 방법💡 DFS, BFS 이용 📌 주의할 점가로, 세로 확인하가Solutionfrom collections import dequedx = [1, 0, -1, 0]dy = [0, -1, 0, 1]N, M = map(int, input().split())war = [input().strip() for _ in range(M)]visited = [[0] * N for _ in range(M)]W, B = 0, 0def dfs(i, j, color): cnt = 1 visited[i][j] = 1 queue = deque() queue.append((i, j)) while queue: ..