Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function lettersCombinations(input) {
- let x = input[0].charCodeAt(0);
- let y = input[1].charCodeAt(0);
- let z = input[2].charCodeAt(0);
- let counter = 0;
- let print = '';
- for (let i = x; i <= y; i++) {
- for (let k = x; k <= y; k++) {
- for (let j = x; j <= y; j++) {
- if (i !== z && k !== z && j !== z) {
- print += String.fromCharCode(i) + String.fromCharCode(k) + String.fromCharCode(j) + ' ';
- counter++;
- }
- }
- }
- }
- console.log(print + counter);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement