queens-attack-21 [Algorithm] queens-attack-2 풀이 안녕하세요 개발자 Sean입니다. 오늘은 queens attack이라는 문제를 풀어보았습니다. 해답 코드는 아래와 같습니다. function queensAttack(n, k, r_q, c_q, obstacles) { // Write your code here let left = 1; let right = n; let high = n; let bottom = 1; const equation = (x) => x + (r_q - c_q); const revEquation = (x) => -x + (r_q + c_q); const getX = (y) => y - (r_q - c_q); const getrevX = (y) => - y + (r_q + c_q); let hightLeft = revEquation(1.. 2022. 12. 3. 이전 1 다음