Notice
Recent Posts
Recent Comments
Link
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- ์ค์ฝํ
- emtion app router
- emotion RSC
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- js
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ์นด์นด์ค ์ฝํ
- suspense ๋น๋๊ธฐ
- ์ต์ ๋์ฒด์ด๋
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ๋ฐฑ์ค 1339๋ฒ nodejs
- suspense ๋ณ๋ชฉํ์
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- suspense react-query
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- ์ฌ์ฉ์ฑ ๊ฐ์
- app router emotion
- js ์ค์ฝํ
- suspense ๋์์๋ฆฌ
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- js ๋ฌธ์์ด ์์ถ
- ๋ฐฑ์ค 1339๋ฒ js
- ๊ตฌ๋ฆํค
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- next13 emotion
- ๋ฐฑ์ค 2108 nodejs
Archives
- Today
- Total
Lennon FE
[๋ฐฑ์ค 2607๋ฒ] ๋น์ทํ ๋จ์ด - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) ๋ณธ๋ฌธ
๐ฅ Algorithm/Baekjoon
[๋ฐฑ์ค 2607๋ฒ] ๋น์ทํ ๋จ์ด - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs)
Lennon 2022. 5. 7. 00:27728x90
๋ฐ์ํ
https://www.acmicpc.net/problem/2607
const { off } = require('process');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
let input = [];
rl.on('line', function (line) {
input.push(line);
if (input.length === +input[0] + 1) {
rl.close();
}
}).on('close', function () {
input.shift();
const firstStr = input[0];
const validationStr = input.slice(1);
console.log(
solution(
firstStr.split(''),
validationStr.map((v) => v.split(''))
)
);
});
function solution(standard, validation) {
let answer = 0;
validation.forEach((v) => {
const start = [...standard];
if (v.length < start.length) {
for (let i = 0; i < v.length; i++) {
if (start.includes(v[i])) {
const idx = start.indexOf(v[i]);
start.splice(idx, 1);
}
}
if (start.length === 1) {
answer++;
}
} else {
for (let i = 0; i < start.length; i++) {
if (v.includes(start[i])) {
const idx = v.indexOf(start[i]);
v.splice(idx, 1);
}
}
if (v.length === 1 || v.length === 0) {
answer++;
}
}
});
return answer;
}
์ค๋ฒ4 ์ฃผ์ ์ ์ ๋ต๋ฅ ์ด 27ํผ์ธ ๋ฌธ์ ์ด๋ค.
๋ณธ์ธ๋ ๊ณ์ ํ๋ ค์ ์๋ฌธ์ ๊ฐ์ง๊ณ ์ฝ๋๋ฅผ ํ์คํ์ค ํด์ํ๋ค๋ณด๋ ๋ฐ๋ณด๊ฐ์ด ์ฒ๋ฆฌํ ๋ถ๋ถ์ด ์์ด์ ๊ทธ๋ฐ ๊ฑฐ์๋ค.
๋น๊ตํ ๋ฌธ์์ด์ ๊ธธ์ด๋ฅผ ๋ฐ์ ธ ๋ ๊ฐ์ง ๊ฒฝ์ฐ๋ก ํด์ํ๋ฉด ์ฝ๊ฒ ํ ์ ์๋ค.
728x90
๋ฐ์ํ
'๐ฅ Algorithm > Baekjoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค 1912๋ฒ] ์ฐ์ํฉ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (1) | 2022.06.06 |
---|---|
[๋ฐฑ์ค 14612๋ฒ] ๊น์๋น - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.05.05 |
[๋ฐฑ์ค 2108๋ฒ] ํต๊ณํ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.05.03 |
[๋ฐฑ์ค 1759๋ฒ] ์ํธ ๋ง๋ค๊ธฐ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.05.02 |
[๋ฐฑ์ค 14503๋ฒ] ๋ก๋ด์ฒญ์๊ธฐ - ์๋ฐ์คํฌ๋ฆฝํธ(nodejs) (0) | 2022.04.30 |
Comments