Created
October 28, 2020 12:11
-
-
Save kurokikaze/81df49711f798ebfaa0c4cf2689d6b71 to your computer and use it in GitHub Desktop.
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
/** | |
* Auto-generated code below aims at helping you parse | |
* the standard input according to the problem statement. | |
**/ | |
const S = readline(); | |
// Write an answer using console.log() | |
// To debug: console.error('Debug messages...'); | |
console.error(S) | |
//console.error(.map(a => a.length - 2)); | |
const matches = S.replace(/\\\\/g, '#').replace(/\\"/g, '#').match(/\"[^\"]+\"/g); | |
console.error(matches); | |
const lengths = (matches && matches.length) ? matches.map(a => a.length - 2): [0]; | |
console.error(lengths) | |
console.log(lengths.reduce((a,b) => a + b, 0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment