b='' puts$<.map{|l,r=[],i=0|l.chomp! r<<(l*9)[i]<<(b*9)[i] l[i+=1]||b[i]?redo:b[i-1]||r.pop b=r*''}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page