문제 이름 : 아이템 줍기 function solution(rectangle, characterX, characterY, itemX, itemY) { let answer = []; let board = Array.from(Array(101), () => new Array(101).fill(0)); rectangle.forEach((el, i)=>{ const yStart = el[1]*2; const yEnd = el[3]*2; const xStart = el[0]*2; const xEnd = el[2]*2; for(let y=yStart; y new Array(101).fill(false)); while(queue.length){ [y, x, cnt] = queue.shift(); visited[y][..
[Programmers] 아이템 줍기 문제 - (javascript)
문제 이름 : 아이템 줍기 function solution(rectangle, characterX, characterY, itemX, itemY) { let answer = []; let board = Array.from(Array(101), () => new Array(101).fill(0)); rectangle.forEach((el, i)=>{ const yStart = el[1]*2; const yEnd = el[3]*2; const xStart = el[0]*2; const xEnd = el[2]*2; for(let y=yStart; y new Array(101).fill(false)); while(queue.length){ [y, x, cnt] = queue.shift(); visited[y][..
2022.02.06