Code Festival D Compress numbers by mitchs ()

while 1:
 a,b=input().split();m=0
 for c in a:m+=int(c);t=str(m%10)==b[:1];b=b[t:];m*=1-t
 print('YNEOS'[b>''or m%10::2])

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page