Advertisement
galink

Untitled

Aug 26th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function passWord ([arg1, arg2]) {
  2. let n = Number(arg1);
  3. let l = Number(arg2);
  4.  
  5. for (let num1 = 1; num1 <= n; num1++) {
  6. for (let num2 =1; num2 <= n; num2++){
  7. for (let letter1 ='a'.charCodeAt(0); letter1 < 'a'.charCodeAt(0) + l; letter1++) {
  8. for (let letter2 = 'a'.charCodeAt(0); letter2 < 'a'.charCodeAt(0) + l; letter2++){
  9. for(let num3 = Math.max(num1, num2) + 1; num3 <= n; num3++){
  10. console.log(num1 + '' + num2 + '' + String.fromCharCode(letter1) + '' + String.fromCharCode(letter2) + num3);
  11. }
  12. }
  13. }
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement