You are viewing a single comment's thread. Return to all comments →
can't get any shorter i guess
dic={0:''};order=0;s='' for i in range(int(input())): t=[_ for _ in input().strip().split()] if t[0]=='1':order+=1;s+=t[1];dic[order]=s elif t[0]=='3':print(s[int(t[1])-1]) elif t[0]=='2':s=s[:len(s)-int(t[1])];order+=1;dic[order]=s elif t[0]=='4':order-=1;s=dic[order]
Seems like cookies are disabled on this browser, please enable them to open this website
Simple Text Editor
You are viewing a single comment's thread. Return to all comments →
can't get any shorter i guess