석유 시추 ( Level 2, JavaScript, PCCP 기출문제)
const bfs = (land, visited, cur, i, j) => { const dx = [-1, 0, 1, 0] const dy = [0, -1, 0, 1] const queue = [[i, j]] let count = 0; while (queue.length) { const [x, y] = queue.shift() visited[x][y] = 1 land[x][y] = cur for (let k = 0; k { const visited = Array.from({ length: land.length }, () => Array(land[0].length).fill(0)); const amount = {} ..