Code Festival D Compress numbers by hallvabo

while~0:
 s,t=raw_input().split()
 while s[1:]:
\x09if s[:1]==t[:1]:s,t=s[1:],t[1:]
\x09else:s=`(int(s[0])+int(s[1]))%10`+s[2:]
 print('YNEOS')[s!=t>''or'0'<s!=t::2]

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

download

return to the top page