Notice
Recent Posts
Recent Comments
Link
목록reduce (1)
나 이것도 몰랐네..
[Node.js] Baekjoon 3052 나머지 풀이
숫자 10개를 입력받아 이를 42로 나눈 서로 다른 나머지 값의 개수를 구하여라. 접근 방식0이 42개 있는 array를 생성 후, 입력받은 값을 42로 나눈 값에 해당하는 인덱스에 1씩 더한다.이 후 array에서 0보다 큰 값이 있는 인덱스의 개수를 구해 출력한다. 구현 코드let rl = require('readline').createInterface({ input: process.stdin, output: process.stdout,})let input = [];rl.on('line', li=>{ input.push(Number(li.trim()));}).on('close', _ => { remainder(input); process.exit();});function r..
알고리즘 문제 풀이
2024. 5. 30. 19:32