Skip to content

2210 #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 16, 2024
Merged

2210 #65

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion javascript/source/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ let path = require('path');
let inputPath = path.join(__dirname, '/dev/stdin'); // __dirname은 현재 스크립트의 디렉토리 절대경로
let input = require('fs').readFileSync(inputPath).toString().trim().split('\n'); //'\r\n'
//let input = require('fs').readFileSync('/dev/stdin').toString().trim().split('\n'); //백준 제출
const board = input.map((el) => el.split(" ").map(Number)); // 숫자판 생성
const uniqueNumbers = new Set(); // 중복 제거를 위한 Set
const directions = [
[-1, 0], // 위
[1, 0], // 아래
[0, -1], // 왼쪽
[0, 1], // 오른쪽
];

let N = input.shift();
let arr = input[0].split(' ').map(el => +el);
Expand Down Expand Up @@ -29,4 +37,4 @@ while (temp.length) {
result[temp.pop()] = -1;
}

console.log(result.join(' '));
console.log(result.join(' '));