Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solution(input = []) {
- let count = input.shift();
- let pattern = /(.+)\>([0-9]{3})\|([a-z]{3})\|([A-Z]{3})\|([^\<\>]{3})\<\1/;
- for (let i = 0; i < count; i++) {
- let result = input[i].match(pattern);
- if (result !== null) {
- console.log(`Password: ${result[2]}${result[3]}${result[4]}${result[5]}`);
- } else {
- console.log("Try another password!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment