반응형
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 | 31 |
Tags
- HTTP
- Crawling
- BFS
- 문자열
- type challenge
- 프로그래머스 레벨 2
- 가천대
- Algorithm
- javascript
- 수학
- ip
- 레벨 1
- 프로그래머스
- Nestjs
- 자바스크립트
- 알고리즘
- 그래프
- 타입스크립트
- typescript
- 백준
- 소켓
- socket
- dfs
- 크롤링
- HTTP 완벽 가이드
- dp
- TCP
- 쉬운 문제
- Node.js
- 타입 챌린지
Archives
- Today
- Total
kakasoo
[node.js] 검증수 ( 백준 2475번 ) 본문
반응형
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on("line", (line) => {
main(line);
}).on("close", () => {
process.exit();
});
/**
*
* @param {string} line
*/
const main = (line) => {
const numbers = line.split(" ").map(Number);
const sum = numbers.map((el) => el * el).reduce((acc, cur) => acc + cur);
console.log(sum % 10);
};반응형
'프로그래밍 > 알고리즘 풀이' 카테고리의 다른 글
| [node.js] A -> B ( 백준 16953번 ) (0) | 2021.03.26 |
|---|---|
| [node.js] 팰린드롬수 ( 백준 1259번 ) (0) | 2021.03.26 |
| [node.js] 스티커 ( 백준 9465번 ) (0) | 2021.03.25 |
| [node.js] 이친수 ( 백준 2193번 ) (0) | 2021.03.25 |
| [node.js] 쉬운 계단 수 ( 백준 10844번 ) (0) | 2021.03.25 |