Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Second solution in Creative category for Safe Code by Tinus_Trotyl
import re
def safe_code(equation):
for c in [chr(48+n) for n in range(0 if not([n for n in re.split("=|\+|-|\*|/", equation) \
if len(n) > 1 and n[:1]=='#']) else 1, 10) if chr(48+n) not in equation]:
if eval(equation.replace('#', c).replace('=', '==')): return int(c)
return -1
Sept. 17, 2018
Comments: