Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. function solve(input){
  2. let input = ['2', '4'];
  3.  
  4. let n = +input.shift();
  5. let l = +input.shift();
  6. let sum = '';
  7.  
  8. for(let a = 1; a < n; a++){
  9. for(let b = 1; b < n; b++){
  10. for(let c = 'a'.charCodeAt(0);c < 'a'.charCodeAt(0) + l;c++){
  11. let firstChar = String.fromCharCode(c)
  12. for(let d = 'a'.charCodeAt(0); d < 'a'.charCodeAt(0)+ l;d++){
  13. let secondChar = String.fromCharCode(d)
  14. for(let e = 1; e <= n ; e++){
  15. if(e > a && e > b){
  16. sum += a + '' + b + firstChar + secondChar + e + ' '
  17. }
  18. }
  19. }
  20. }
  21. }
  22. }
  23. console.log(sum)
  24.  
  25. }
  26. solve();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement