Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function
- stupidPasswordGenerator([arg1, arg2]) {
- let n = Number(arg1);
- let L = Number(arg2);
- let result = "";
- for (let firstDigit = 1; firstDigit <= n; firstDigit++) {
- for (let secondDigit = 1; secondDigit <= n; secondDigit++) {
- for (let thirdDigit = 97; thirdDigit < 97 + L; thirdDigit++) {
- let a = String.fromCharCode(thirdDigit)
- for (let fourthDigit = 97; fourthDigit < 97 + L; fourthDigit++) {
- let b = String.fromCharCode(fourthDigit)
- for (let fifthDigit = firstDigit + secondDigit; fifthDigit <= n; fifthDigit++) {
- // if (fifthDigit <= firstDigit && fifthDigit <= secondDigit) {
- // fifthDigit++
- // } else if (fifthDigit <= firstDigit) {
- // fifthDigit++
- // } else if (fifthDigit <= secondDigit) {
- // fifthDigit++
- // }
- result += firstDigit + "" + secondDigit + "" + a + "" + b + "" + fifthDigit + " "
- }
- }
- }
- }
- }
- console.log(result)
- }
- stupidPasswordGenerator(["3", "1"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement