Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function rageQuit (input){
- let regexString = /[^\d]+/g;
- let regexNum = /[\d]+/g;
- input = input.shift()
- let finalString = '';
- let txt = input.match(regexString);
- let num = input.match(regexNum);
- for(let i = 0; i < txt.length; i++){
- let messag = txt[i].toUpperCase();
- let number = Number(num[i]);
- finalString += messag.repeat(number);
- }
- // for (let el of a){
- // uniqueSymbols[el] = 0;
- // }
- // let addToFinalString = '';
- // for(let j = 1; j <= Number(num[i]); j++) {
- // addToFinalString += a;
- // }
- // finalString +=
- let uniqueSymbols = new Set (finalString).size
- // console.log(uniqueSymbols)
- //let finalUniqueSymbols = Object.keys(uniqueSymbols);
- console.log(`Unique symbols used: ${uniqueSymbols}`);
- console.log(finalString);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement