Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Silver V] Title: 크로아티아 알파벳, Time: 124 ms, Memory: 9360 KB -BaekjoonHub
- Loading branch information
1 parent
e3017d1
commit e6e49fe
Showing
2 changed files
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
### 성능 요약 | ||
|
||
메모리: 9352 KB, 시간: 128 ms | ||
메모리: 9360 KB, 시간: 124 ms | ||
|
||
### 분류 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
var fs = require("fs"); | ||
const filePath = process.platform === "linux" ? "/dev/stdin" : "test.txt"; | ||
let input = fs.readFileSync(filePath).toString().trim(); | ||
const croatia = ["c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="]; | ||
let cnt = 0; | ||
for (let s of croatia) { | ||
input = input.split(s).join("Z"); | ||
} | ||
input = input.replace(/(c\=|c\-|dz\=|d\-|lj|nj|s\=|z\=)/g, "Z"); | ||
console.log(input.length); |