Advertisement
Spocoman

14. Password Generator

Jan 1st, 2022
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function  passwordGenerator(input) {
  2.     let n = Number(input[0]);
  3.     let l = Number(input[1]);
  4.     let print = '';
  5.     for (let a = 1; a <= n; a++) {
  6.         for (let b = 1; b <= n; b++) {
  7.             for (let c = 97; c < 97 + l; c++) {
  8.                 for (let d = 97; d < 97 + l; d++) {
  9.                     for (let e = 1; e <= n; e++) {
  10.                         if (a < e && e > b) {
  11.                             print += `${a}${b}${String.fromCharCode(c)}${String.fromCharCode(d)}${e} `;
  12.                         }
  13.                     }
  14.                 }
  15.             }
  16.         }
  17.     }
  18.     console.log(print.trimEnd());
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement