Skip to content

Instantly share code, notes, and snippets.

@mdewey
Created March 8, 2019 19:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdewey/021d47931bbd95b3622e526de85f44ba to your computer and use it in GitHub Desktop.
Save mdewey/021d47931bbd95b3622e526de85f44ba to your computer and use it in GitHub Desktop.
function solution(input, markers) {
return input.split('\n').map((line) => {
let lineRv = "";
for(let i =0; i< line.length;i++){
if (markers.includes(line[i])){
i = line.length + 1;
} else {
lineRv += line[i]
}
}
return lineRv.trim();
}).join('\n');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment