Skip to main content
deleted 601 characters in body
Source Link
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.


Python 2, 101104 bytes

lambda a:[i for i in range(a/4,a*4)if sum((q in'90')*6+(int(p)-int(q))**2for p,q in zip(`a`,`i``i*10`))==5]

Try it online!Try it online!

Input as a single integer. [6, 5, 2] as an integer 652. Output list of integers.

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.


Python 2, 101 bytes

lambda a:[i for i in range(a/4,a*4)if sum((q in'90')*6+(int(p)-int(q))**2for p,q in zip(`a`,`i`))==5]

Try it online!

Input as a single integer. [6, 5, 2] as 652.

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.


Python 2, 104 bytes

lambda a:[i for i in range(a/4,a*4)if sum((q in'90')*6+(int(p)-int(q))**2for p,q in zip(`a`,`i*10`))==5]

Try it online!

Input [6, 5, 2] as an integer 652. Output list of integers.

added 654 characters in body
Source Link
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.


Python 2, 101 bytes

lambda a:[i for i in range(a/4,a*4)if sum((q in'90')*6+(int(p)-int(q))**2for p,q in zip(`a`,`i`))==5]

Try it online!

Input as a single integer. [6, 5, 2] as 652.

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.

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.


Python 2, 101 bytes

lambda a:[i for i in range(a/4,a*4)if sum((q in'90')*6+(int(p)-int(q))**2for p,q in zip(`a`,`i`))==5]

Try it online!

Input as a single integer. [6, 5, 2] as 652.

Source Link
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.