Created
March 8, 2019 19:31
-
-
Save mdewey/021d47931bbd95b3622e526de85f44ba 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
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