Advertisement
Guest User

Untitled

a guest
Feb 29th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function passwordGeneration(input) {
  2.     let n = Number(input[0]);
  3.     let l = Number(input[1]);
  4.  
  5.     let result = "";
  6.  
  7.     for (let a = 1; a < n; a++) {
  8.         for (let b = 1; b < n; b++) {
  9.  
  10.             for (let c = 97; c < 97 + l; c++) {
  11.                 let firstChar = String.fromCharCode(c);
  12.  
  13.                 for (let d = 97; d < 97 + l; d++) {
  14.                     let secondChar = String.fromCharCode(d);
  15.  
  16.                     for (let e = 1; e <= n; e++) {
  17.                         if (a < e && b < e) {
  18.                             result += a + "" + b + firstChar + secondChar + e + " " ;
  19.                             // слагаме "" , за да слее a, b и c и да ги конкатенира
  20.                         }
  21.                     }
  22.                 }
  23.             }
  24.         }
  25.     }
  26.     console.log(result);
  27. }
  28. passwordGeneration(['2', '4'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement