Function of Backspace Key

⚠⚠One samll request to all
please change variables to solve programs that's safe for 'u'



s=input().strip()

l=[]

for i in s:

    if i=='-':

        if l:

            l.pop()

    else:

        l.append(i)

if l:

    print(*l,sep='')

else:

    print(-1)

Post a Comment

0 Comments