
Programmers / [PCCP 기출문제] 2번 / 석유 시추 / python
·
코딩테스트/programmers (python)
문제 : https://school.programmers.co.kr/learn/courses/30/lessons/250136 나의 풀이from collections import dequedef solution(land): n, m = len(land), len(land[0]) visited = [[False] * m for _ in range(n)] col_oil = [0] * m def bfs(a, b): dx = [-1, 1, 0, 0] dy = [0, 0, -1, 1] queue = deque([(a, b)]) visited[a][b] = True size = 0 colu..