Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(input) {
- let a = Number(input[0]);
- let b = Number(input[1]);
- let countMaxPasswords = Number(input[2]);
- let counterPasswords = 0;
- let A = '';
- let B = '';
- let passwords = '';
- let i = 35;
- let j = 64;
- label:
- for (let x = 1; x <= a; x++) {
- for (let y = 1; y <= b; y++) {
- A = String.fromCharCode(i);
- i++;
- if (i > 55) {
- i = 35;
- }
- B = String.fromCharCode(j);
- j++;
- if (j > 96) {
- j = 64;
- }
- passwords += `${A}${B}${x}${y}${B}${A}|`;
- counterPasswords++;
- if (counterPasswords === countMaxPasswords || y === b && x === a) {
- break label;
- }
- }
- }
- console.log(passwords);
- }
- solve([
- '2',
- '3',
- '10'
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement