Skip to content

Instantly share code, notes, and snippets.

@kurokikaze
Created October 28, 2020 12:11
Show Gist options
  • Save kurokikaze/81df49711f798ebfaa0c4cf2689d6b71 to your computer and use it in GitHub Desktop.
Save kurokikaze/81df49711f798ebfaa0c4cf2689d6b71 to your computer and use it in GitHub Desktop.
/**
* 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