diff --git a/src/bj/silver/4/README.md b/src/bj/silver/4/README.md index f4e28c37..7a2a1820 100644 --- a/src/bj/silver/4/README.md +++ b/src/bj/silver/4/README.md @@ -27,4 +27,4 @@ | 23 | 10866 | [덱](./10866.js) | 23.01.04 | O | | 24 | 11047 | [동전0](./11047.js) | 23.01.13 | O | [23.01.16](./replay/11047.js) | | 25 | 17219 | [비밀번호 찾기](./17219.js) | 23.01.24 | O | -| 26 | 1065 | [한수](./1065.js) | 23.02.09 | X | +| 26 | 1065 | [한수](./1065.js) | 23.02.09 | X | [23.02.11](./replay/1065.js) | diff --git a/src/bj/silver/4/replay/1065.js b/src/bj/silver/4/replay/1065.js new file mode 100644 index 00000000..a5591372 --- /dev/null +++ b/src/bj/silver/4/replay/1065.js @@ -0,0 +1,20 @@ +"use strict"; + +const n = require("fs").readFileSync("/dev/stdin").toString(); +const solution = (n) => { + let answer = 0; + for (let i = 1; i <= n; i++) { + if (i < 100) { + answer++; + continue; + } + let nStr = i + ""; + let a = +nStr[0] - +nStr[1]; + let b = +nStr[1] - +nStr[2]; + + if (a === b) answer++; + } + return answer; +}; + +console.log(solution(+n));