dimitrix85

Hard Word

Nov 15th, 2019
91
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(input){
  2.     let [string,words] = input;
  3.     words.forEach((el,i) => {
  4.         let regex = new RegExp(`\\b_{${el.length}}\\b`,"mig",);
  5.         string = string.replace(regex,el)
  6.     });
  7.     return string;
  8. }
RAW Paste Data