Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(args) {
- const input = args.slice(1);
- const regPat = /\|(?<boss>[A-Z]+){4}\|(:)(#)(?<title>[A-z]+\s[A-z]+)(#)/g;
- input.forEach((line) => {
- if (regPat.test(line)) {
- line = line.replace(/[|#]/g, '');
- const [bossName, title] = line.split(':');
- console.log(`${bossName}, The ${title}`);
- console.log(`>> Strength: ${bossName.length}`);
- console.log(`>> Armour: ${title.length}`);
- } else {
- console.log('Access denied!');
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement