๐Ÿ’› JavaScript/๋ฐฑ์ค€

๐Ÿ’› JavaScript/๋ฐฑ์ค€

    [JS] 10809

    let fs = require('fs'); let path = process.platform === 'linux' ? '/dev/stdin' : './input.txt'; let input = fs.readFileSync(path).toString().trim(); function solve(input) { let answerArray = new Array(); for (i = 97; i

    [JS] 1065

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./input.txt&#39;; const input = Number(fs.readFileSync(path).toString().trim()); function solve(input) { if (input < 100) { return input; } else if (input

    [JS] 4673

    const NUMBER = 10000; function solve(number) { let arr = new Array(); for (i = 1; i Number(x)).reduce((acc, cur) => acc + cur); arr.push(sum); } for (i = 1; i

    [JS] 10818

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./input.txt&#39;; const input = fs.readFileSync(path).toString().split(&#39;\n&#39;); function solve(input) { const count = Number(input[0]); const array = input[1].split(&#39; &#39;).map((value) => Number(value)); console.log(`${Math.min(...array)} ${Math.max(...array)}`); // array...

    [JS] 3052

    const fs = require(&#39;fs&#39;); const path = process.platform === &#39;linux&#39; ? &#39;/dev/stdin&#39; : &#39;./input.txt&#39;; const input = fs .readFileSync(path) .toString() .trim() .split(&#39;\n&#39;) .map((x) => Number(x)); const inputDiv = input.map((x) => x % 42); const answer = new Set(inputDiv); console.log([...answer].length); ๋ฐฑ์ค€ trim() ์œ ๋ฌด์— ๋”ฐ๋ผ ์ •๋‹ต์ด ๋˜๊ธฐ๋„ ์•ˆ๋˜๊ธฐ๋„ => ์ด์œ ๋ฅผ ๋ชจ๋ฅด๊ณ˜๋‹ค. ์•ž๋’ค ๊ณต๋ฐฑ ์ œ๊ฑฐํ•ด์ฃผ๋‚˜..