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