Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. function
  2. stupidPasswordGenerator([arg1, arg2]) {
  3. let n = Number(arg1);
  4. let L = Number(arg2);
  5. let result = "";
  6. for (let firstDigit = 1; firstDigit <= n; firstDigit++) {
  7. for (let secondDigit = 1; secondDigit <= n; secondDigit++) {
  8. for (let thirdDigit = 97; thirdDigit < 97 + L; thirdDigit++) {
  9. let a = String.fromCharCode(thirdDigit)
  10. for (let fourthDigit = 97; fourthDigit < 97 + L; fourthDigit++) {
  11. let b = String.fromCharCode(fourthDigit)
  12.  
  13. for (let fifthDigit = firstDigit + secondDigit; fifthDigit <= n; fifthDigit++) {
  14. // if (fifthDigit <= firstDigit && fifthDigit <= secondDigit) {
  15. // fifthDigit++
  16. // } else if (fifthDigit <= firstDigit) {
  17. // fifthDigit++
  18. // } else if (fifthDigit <= secondDigit) {
  19. // fifthDigit++
  20. // }
  21. result += firstDigit + "" + secondDigit + "" + a + "" + b + "" + fifthDigit + " "
  22. }
  23. }
  24. }
  25. }
  26. }
  27. console.log(result)
  28. }
  29. stupidPasswordGenerator(["3", "1"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement