본문 바로가기
TIL

[TIL] 2021. 09. 25.

by 박헹구 2021. 9. 25.
반응형
2021. 09. 25.

 

◾ Today's study

알수가 없는 알고리즘의 세계

모르겠어서 선택님 찾아가서 물어봤다.

이렇게 하면 정답이고

const fs = require('fs');
const input = fs.readFileSync('dev/stdin').toString().trim().split('\n')

let Array = input.map((input) => input % 42);
let set = new Set(Array);
const Arr = [...set];

console.log(Arr.length);

이렇게 하면 틀리다 오묘한 세계다 증말

const fs = require('fs');

const filepath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";
let input = fs.readFileSync(filepath).toString().split("\n")

// 

let Array = input.map((input) => input % 42);
let set = new Set(Array);
const Arr = [...set];

console.log(Arr.length);

 

나는 단지 내 창에서 답을 확인하고 싶어서 filepath를 넣은건데 왜그러는건데 도대체 ㅠㅠㅠㅠㅠㅠㅠㅠ

저거때문에 머리싸맨 시간이 너무 아깝다 

아 물론 오늘 노마드도 다했다.

내일은 쉬는날이니까 열심히 본격적으로 쉬어주겠다


◾ To do tomorrow

쉬는날이다 드디어 야호😀

 

반응형

'TIL' 카테고리의 다른 글

[TIL] 2021. 09. 29.  (0) 2021.09.29
[TIL] 2021. 09. 28.  (0) 2021.09.28
[TIL] 2021. 09. 24.  (0) 2021.09.24
[TIL] 2021. 09. 23.  (0) 2021.09.23
[TIL] 2021. 09. 21.  (0) 2021.09.21

댓글