Skip to main content
Commonmark migration
Source Link

#JavaScript (ES6), 78

JavaScript (ES6), 78

n=>eval("for(i=0;n;!p|i%s|i%p||n--)[...++i+''].map(d=>(s-=d,p*=d),s=0,p=1);i")

Less golfed

n=>{
  for(i=0; n; !p|i%s|i%p || n--)
    s=0,
    p=1,
    [...++i+''].map(d=>(s-=d, p*=d));
  return i
}  

#JavaScript (ES6), 78

n=>eval("for(i=0;n;!p|i%s|i%p||n--)[...++i+''].map(d=>(s-=d,p*=d),s=0,p=1);i")

Less golfed

n=>{
  for(i=0; n; !p|i%s|i%p || n--)
    s=0,
    p=1,
    [...++i+''].map(d=>(s-=d, p*=d));
  return i
}  

JavaScript (ES6), 78

n=>eval("for(i=0;n;!p|i%s|i%p||n--)[...++i+''].map(d=>(s-=d,p*=d),s=0,p=1);i")

Less golfed

n=>{
  for(i=0; n; !p|i%s|i%p || n--)
    s=0,
    p=1,
    [...++i+''].map(d=>(s-=d, p*=d));
  return i
}  
Source Link
edc65
  • 32.2k
  • 3
  • 36
  • 90

#JavaScript (ES6), 78

n=>eval("for(i=0;n;!p|i%s|i%p||n--)[...++i+''].map(d=>(s-=d,p*=d),s=0,p=1);i")

Less golfed

n=>{
  for(i=0; n; !p|i%s|i%p || n--)
    s=0,
    p=1,
    [...++i+''].map(d=>(s-=d, p*=d));
  return i
}