puts $<.map{|e| \x09a,b=e.split \x09c=j=0 \x09a.bytes{|x| \x09\x09c=(c+x-48)%10 \x09\x09c.to_s==b[j,1]&&(j+=1;c=0) \x09} \x09b.size-j+c==0?:YES: :NO }
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page