Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input){
- let [string,words] = input;
- words.forEach((el,i) => {
- let regex = new RegExp(`\\b_{${el.length}}\\b`,"mig",);
- string = string.replace(regex,el)
- });
- return string;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement