Skip to content

Instantly share code, notes, and snippets.

@kurokikaze

kurokikaze/test.js

Created Oct 28, 2020
Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.