BOJ 3052

슬기로운 FE 세상·2022년 3월 19일
0

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

const answer = [];

input.forEach((v => {
    let num = v % 42;

    if(answer.indexOf(num) === -1) answer.push(num);
}))

console.log(answer.length);

나머지 연산자로 나눠서 indexOf가 -1이 나오면 push

profile
자 드가자~~

0개의 댓글