swAira's blog

By swAira, history, 7 weeks ago, In English

Hey If anyone can tell me the mistake I am doing in the code. Its showing runtime error on test 4 I have mentioned the problem and my submission below 1200A - Hotelier 88921749 My code's below for ease

n=int(input()) s=['0']*10 l=input() a=0 b=9 for i in l: if i=='L': s[a]='1' while s[a]=='1': a+=1 elif i=='R': s[b]='1' while s[b]=='1': b-=1 else: ii=int(i) s[ii]='0' if a>ii: a=ii else: b=ii print ("".join(s))

Thanks in advance

  • Vote: I like it
  • -5
  • Vote: I do not like it