Skip to content

Instantly share code, notes, and snippets.

@railsstudent
Created December 24, 2016 02:19
Show Gist options
  • Save railsstudent/3658220f7fc9d234ead242ad54a42b8c to your computer and use it in GitHub Desktop.
Save railsstudent/3658220f7fc9d234ead242ad54a42b8c to your computer and use it in GitHub Desktop.
function solution(input, markers){
var comments = input.split('\n');
for (var i in markers) {
for (var j in comments) {
var line = null;
var idx = comments[j].indexOf(markers[i]);
if (idx >= 0) {
comments[j] = comments[j].substring(0, idx).trim();
}
}
}
return comments.join('\n');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment