๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๊ฐœ์ธ๊ณต๋ถ€/Algorithm

[๋ฐฑ์ค€][Node.js] 2711๋ฒˆ : ์˜คํƒ€๋งจ ๊ณ ์ฐฝ์˜

by ๐Ÿ‡๋ฐ•๋ด‰๋ด‰๐Ÿ‡ 2021. 9. 7.

 

 

Algorithm

-  ์˜คํƒ€๋งจ ๊ณ ์ฐฝ์˜ -

 


 

๋ฌธ์ œ

๊ณ ์ฐฝ์˜์€ ๋งจ๋‚  ์˜คํƒ€๋ฅผ ๋‚ธ๋‹ค. ์ฐฝ์˜์ด๊ฐ€ ์˜คํƒ€๋ฅผ ๋‚ธ ๋ฌธ์žฅ๊ณผ ์˜คํƒ€๋ฅผ ๋‚ธ ์œ„์น˜๊ฐ€ ์ฃผ์–ด์กŒ์„ ๋•Œ, ์˜คํƒ€๋ฅผ ์ง€์šด ๋ฌธ์ž์—ด์„ ์ถœ๋ ฅํ•˜๋Š” ํ”„๋กœ๊ทธ๋žจ์„ ์ž‘์„ฑํ•˜์‹œ์˜ค.

์ฐฝ์˜์ด๋Š” ์˜คํƒ€๋ฅผ ๋ฐ˜๋“œ์‹œ 1๊ฐœ๋งŒ ๋‚ธ๋‹ค.

 

์ž…์ถœ๋ ฅ ์˜ˆ์‹œ

 

๋ฌธ์ œ ํ’€๊ธฐ

let fs = require("fs");
let input = fs.readFileSync("/dev/stdin")
	.toString()
	.split("\n");

for (let i = 1; i <= +input[0]; i++) {
	let word = input[i].split(" ");
	word[1] = word[1].split("");
	word[1].splice(+word[0] - 1, 1);
	console.log(word[1].join(''));
}

 

 

 

๋ฐ˜์‘ํ˜•

๋Œ“๊ธ€