answer = function (range) {
let a,b,c,d,e,f,pwd,N ;
let pwds = [];
for (a=0; a<10; a++) {
for (b=a; b<10; b++) {
for (c=b; c<10; c++) {
for (d=c; d<10; d++) {
for (e=d; e<10; e++) {
for (f=e; f<10; f++) {
pwd = [a,b,c,d,e,f];
if (!pwd.some( (d,i,a) => d == a[i+1] )) continue
N = Number(pwd.join(''));
if (N < range[0]) continue
if (N > range[1]) continue
pwds.push(pwd);
}
}
}
}
}
}
return {n: pwds.length, pwds: pwds};
}