antimatter explosion by rolf

while 1:
 s=input()
 while 1:
  f=0  
  for i in range(len(s)-1):
   if abs(ord(s[i])-ord(s[i+1]))==32:
    s=s[:i]+"**"+s[i+2:]
    f=1
  t=""  
  for c in s:
   if c!="*":t+=c
  s=t
  if f==0:break
 if s=="":
  print(1)
 else:
  print(0)  

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

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page