Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function passwordGeneration(input) {
- let n = Number(input[0]);
- let l = Number(input[1]);
- let result = "";
- for (let a = 1; a < n; a++) {
- for (let b = 1; b < n; b++) {
- for (let c = 97; c < 97 + l; c++) {
- let firstChar = String.fromCharCode(c);
- for (let d = 97; d < 97 + l; d++) {
- let secondChar = String.fromCharCode(d);
- for (let e = 1; e <= n; e++) {
- if (a < e && b < e) {
- result += a + "" + b + firstChar + secondChar + e + " " ;
- // слагаме "" , за да слее a, b и c и да ги конкатенира
- }
- }
- }
- }
- }
- }
- console.log(result);
- }
- passwordGeneration(['2', '4'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement