Skip to main content
1 of 3
tsh
  • 35.6k
  • 2
  • 34
  • 129

JavaScript (V8), 96 bytes

a=>{for(i=a>>2;++i<a*4;)/[09]/.test(i)|[...a].map((n,j)=>s+=((i+'')[j]-n)**2,s=0)^s^5||print(i)}

Try it online!

Input is a string, for example, [6, 5, 2] is inputed as "652". Output each answer per line to stdout.

tsh
  • 35.6k
  • 2
  • 34
  • 129