Problem:


Score : 200 points

Problem Statement

Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has 3 keys on it: the 0 key, the 1 key and the backspace key.

To begin with, he is using a plain text editor with this keyboard. This editor always displays one string (possibly empty). Just after the editor is launched, this string is empty. When each key on the keyboard is pressed, the following changes occur to the string:

The 0 key: a letter 0 will be inserted to the right of the string.

The 1 key: a letter 1 will be inserted to the right of the string.

The backspace key: if the string is empty, nothing happens. Otherwise, the rightmost letter of the string is deleted.

Sig has launched the editor, and pressed these keys several times. You are given a string s, which is a record of his keystrokes in order. In this string, the letter 0 stands for the 0 key, the letter 1 stands for the 1 key and the letter B stands for the backspace key. What string is displayed in the editor now?

Constraints

1 ≦ |s| ≦ 10 (|s| denotes the length of s)

s consists of the letters 0, 1 and B.

The correct answer is not an empty string.

Input

The input is given from Standard Input in the following format:

s

Output

Print the string displayed in the editor in the end.

Sample Input 1

01B0

Sample Output 1

00

Each time the key is pressed, the string in the editor will change as follows: 0, 01, 0, 00.

Sample Input 2

0BB1

Sample Output 2

1

Each time the key is pressed, the string in the editor will change as follows: 0, (empty), (empty), 1.



Sample input:
01B0


Sample output:
00

Submission status: Wrong Answer

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()
ans = [''] * len(S)
cur = 0
for s in S:
    if s == 'B':
        ans[cur] = ''
        cur -= 1
        cur = max(0, cur)
    else:
        ans[cur] = s
        cur += 1

print("".join(ans))

Submission status: Wrong Answer

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()
ans = [''] * len(S)
cur = 0
for s in S:
    if s == 'B':
        ans[cur] = ''
        cur -= 1
    else:
        ans[cur] = s
        cur += 1

print("".join(ans))

Submission status: Wrong Answer

Solution code:
def solve():
    s = list(input())

    ans = []
    for i in range(len(s)):
        if s[i] != 'B':
            ans.append(s[i])
        elif s[i] == 'B' and ans:
            ans.remove(ans[-1])
        

    return ''.join(ans)

    
print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    s = list(input())

    if s[0] == 'B':
        s[0] = ''

    for i in range(1, len(s)):
        if s[i] == 'B':
            s[i-1], s[i] ='', ''


    return ''.join(s)

    
print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    s = list(input())

    if s[0] == 'B':
        s[0] == ''

    for i in range(1, len(s)):
        if s[i] == 'B':
            s[i-1], s[i] ='', ''


    return ''.join(s)

    
print(solve())

Submission status: Wrong Answer

Solution code:
def myAnswer(s:list)->str:
   ans = []
   for string in s:
      if(string == "B"):
         if(ans == []):
            continue
         else:
            ans.pop()
      else:
         ans.append(string)
   print(ans)
   return "".join(ans)

def modelAnswer():
   return
def main():
   s = list(input())
   print(myAnswer(s))
if __name__ == '__main__':
   main()

Submission status: Wrong Answer

Solution code:
ss=input().split()
r=''
for i, s in enumerate(ss):
  if s!='B':
    r+=s
  elif len(r)>0:
    r=r[:-1]
print(r)

Submission status: Wrong Answer

Solution code:
ss=input().split()
r=''
for s in ss:
  if s!='B':
    r+=s
  elif len(r)>0:
    r=r[:-1]
print(r)

Submission status: Wrong Answer

Solution code:
ss=input().split()
r=''
for s in ss:
  if s=='B' and len(r)>0:
    r=r[:-1]
  else:
    r+=s
print(r)

Submission status: Wrong Answer

Solution code:
s = input()
x = ''
for i in s:
    if i == 'B':
        x += i
    else:
        x = x[:-1]
print(x)

Submission status: Wrong Answer

Solution code:
a=input()
b=''
for i in a:
    if i=='0':
        b+='0'
    elif i=='1':
        b+='0'
    else:
        b+=b[:-1]
print(b)

Submission status: Wrong Answer

Solution code:
a=input()
b=''
for i in a:
    if i=='0':
        b+='0'
    elif i=='1':
        b+='0'
    else:
        b=b[:-1]
print(b)

Submission status: Wrong Answer

Solution code:
s = list(input())
answer = []

for i in s:
        if  i == "B":
            try:
                answer.pop()
            except IndexError:
                pass
        else:
            answer.append(i)

print(" ".join(answer))

Submission status: Wrong Answer

Solution code:
string = input()

length = len(string)

result = ""

for l in range(0, length-1):
    if string[l] != 'B':
        if string[l+1] != 'B':
            result += string[l]

result += string[length-1]

print(result)

Submission status: Wrong Answer

Solution code:
string = input()

length = len(string)

result = ""

for l in range(0, length-1):
    if string[l] != 'B' and string[l+1] != 'B':
        result += string[l]

result += string[length-1]

print(result)

Submission status: Wrong Answer

Solution code:
S=str(input())
str_ = ""
for i in range(len(S)):
  if S[i] == "0" or S[i] == "1":
    str_ = str_ + S[i]
  elif len(str_) != 0:
    str_ = str_.rstrip()
print(str_)

Submission status: Wrong Answer

Solution code:
S=str(input())
str_ = ""
for i in range(len(S)):
  if S[i] == "0" or "1":
    str_ = str_ + S[i]
  elif len(str_) != 0:
    str_ = str_.rstrip()
print(str_)

Submission status: Wrong Answer

Solution code:
s = input(str)

ans = ""
for i in range(len(s)):
  if (s[i] == '0'):
    ans += '0'
  elif (s[i] == '1'):
    ans += '0'
  else:
    if (len(ans) > 0):
      ans = ans[:len(ans)-1]

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
ans = ''
for i in range(len(s)):
    if s[i] == 'B':
        ans = ans[:i-1]
    elif s[i] == '0':
        ans += '0'
    else:
        ans += '1'
print(ans)

Submission status: Wrong Answer

Solution code:
s = ''
while True:
    try:
        x = input()
        if x == 'B' and len(s)!=0:
            s.rstrip()
        elif x == 'B' and len(s)==0:
            pass
        else:
            s = s+x
    except EOFError:
        break
print(s)

Submission status: Wrong Answer

Solution code:
arg=input()
ans=[]
for char in arg:
  if char=='1' or char=='0':
    ans.append(char)
    print(ans)
  elif char=='B':
    if ans!=[]:
      del ans[-1]
      print(ans)
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
string_input=list(input())
string_output=[]
print(string_input)

for i in range(0,len(string_input)-1):
    if string_input[i+1]!="B" and string_input[i]!="B" :
        string_output.append(string_input[i])
        print(string_output)
        
    elif string_input[len(string_input)-1]!="B": #and string_input[len(string_input)-2]!="B":
        string_output.append(string_input[len(string_input)-2])
        string_output.append(string_input[len(string_input)-1])
        
        
    
print(string_output)

string_input=''.join(string_input)
print(string_input)

Submission status: Wrong Answer

Solution code:
S = list(input())
Answer = []

for s in S:
    if s == 'B' and Answer != []:
        del Answer[-1]
    else:
        Answer.append(s)

print(*Answer, sep="")

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import deque
input = stdin.readline

s = input().rstrip()
d = deque([])

for i in s:
    if s != "B":
        d.append(s)
    else:
        if d:
            d.pop()
        else:
            pass

while d:
    p = d.popleft()
    print(p, end="")

print()

Submission status: Wrong Answer

Solution code:
from sys import stdin
from collections import deque
input = stdin.readline

s = input()
d = deque([])

for i in s:
    if s != "B":
        d.append(s)
    else:
        if d:
            d.pop()
        else:
            pass

print("".join(d))

Submission status: Wrong Answer

Solution code:
y=""
a=str(input())
print(len(a))
for i in range (len(a)):
    if a[i]=="B":
        y=y[:-1]
    else:
        y=y+a[i]
print(y)

Submission status: Wrong Answer

Solution code:
s=list(input())
res=[]
for i in s:
    if i=="b":
        res=res[:-1]
    else:
        res.append(i)
res="".join(res)
print(res)

Submission status: Wrong Answer

Solution code:
s=list(input())
res=[]
for i in s:
    if i=="b":
        res=res[:-1]
    else:
        res.append(i)
print("".join(res))

Submission status: Wrong Answer

Solution code:
S = input()
stack = []

for s in S:
  if s == "B" :
    if not stack:
      continue
    else:
      stack.pop()
      
  elif s == 0 or s==1:
    stack.append(s)
    
    
print("".join(stack))

Submission status: Wrong Answer

Solution code:
key = input()
s = []
for i in key:
  if i == '0' or i == '1':
    s.append(i)
  else:
    if len(s) > 0:
      s.pop(-1)
print(s)

Submission status: Wrong Answer

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    S = input()

    ret, i = '', 0
    while i < len(S):
        if S[i] == 'B':
            if i <= 1:
                ret = ''
            else:
                ret = ret[:i-1] + ret[i+1:]
        else:
            ret += S[i]
        i += 1
    # 出力
    print(ret)



# EOF

Submission status: Wrong Answer

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key



__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

def mulinputs():
    return map(int,input().split())

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x



if __name__ == '__main__':
    S = input()

    ret, i = '', 0
    while i < len(S):
        if S[i] == 'B':
            if i == 0:
                ret = ''
            else:
                ret = ret[:-2]
        else:
            ret += S[i]
        i += 1
    # 出力
    print(ret)



# EOF

Submission status: Wrong Answer

Solution code:
s=input()
ans=""

for i in range(len(s)):
  if s[i]=="B":
    if ans=="":
      pass
    else:
      ans=ans.strip(ans[-1])
  else:
    ans+=s[i]
    
print(ans)

Submission status: Wrong Answer

Solution code:
s = list(input())
l = []

for i in range(len(s)):
    if s[i] == "B":
        try:
            l[i-1] = ""
        except:
            pass
    else:
        l.append(s[i])

print("".join(l))

Submission status: Wrong Answer

Solution code:
s = list(input())
l = []

for i in range(len(s)):
    if s[i] == "B":
        l.append(i)

for i in l:
    s[i] = ""
    if i-1 >= 0:
        s[i-1] = ""

print("".join(s))

Submission status: Wrong Answer

Solution code:
s = input()
S = []
for i in range(len(s)):
    S.append(s[i])
j = 0

while True:
    if S[j] == "B" and j != 0:
        del S[j - 1]
        del S[j - 1]
        j = 0
    elif S[j] == "B" and j == 0:
        del S[j]
    else:
        j = j + 1
        if j == len(S) - 1 or len(S) == 1:
            break

print("".join(S))

Submission status: Wrong Answer

Solution code:
#ABC043.B
s = input()
L = []

def kan(a):
    if s =='0':
        L.append('0')
    elif s =='1':
        L.append('1')
    else:
        if L !=[]:
            L.pop()
for b in L:
    kan(b)

c =''
for d in L:
    c +=d
print(c)

Submission status: Wrong Answer

Solution code:
def main():

    s = list(input())
    now = 0
    ans = [''] * 10
    for i, ss in enumerate(s):
        if ss == '0':
            ans[now] = '0'
            now += 1
        elif ss == '1':
            ans[now] = '1'
            now += 1
        else:
            now -= 1
            now = max(0,now)
            ans[now] = ''
    strans = ''
    for i, a in enumerate(ans):
        if a == '':
            print(strans)
            return
        else:
            strans += a


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
s= input()+"x"

ans = ""

for i in range(len(s)-1):
    if s[i]!="B" and s[i+1]!="B":
        ans += s[i]
    else:
        continue
print(ans)

Submission status: Wrong Answer

Solution code:
string = str(input())

str_len = len(string)

out_string = ""

for num in range(str_len):

    if string[num] == "B":
        if len(out_string) != 0:
            out_string = out_string[:num-1]

    else:
        out_string += string[num]


print(out_string)

Submission status: Wrong Answer

Solution code:
string = str(input())

str_len = len(string)

out_string = ""

for num in range(str_len):

    if string[num] == "0":
        out_string += "0"

    elif string[num] == "1":
        out_string += "1"

    elif string[num] == "B":
        if not len(out_string) == 0:
            out_string = out_string[:num-1]

print(out_string)

Submission status: Wrong Answer

Solution code:
string = str(input())

str_len = len(string)

out_string = ""

for num in range(str_len):

    if string[num] == "0":
        out_string += "0"

    elif string[num] == "1":
        out_string += "1"

    elif string[num] == "B":
        out_string = out_string[:num-1]

print(out_string)

Submission status: Wrong Answer

Solution code:
from collections import deque
que = deque()
s = input()
n = len(s)
for i in range(n):
    if s[i] == '0':
        que.appendleft('0')
    if s[i] == '1':
        que.append('1')
    if s[i] == 'B':
        if len(que)==0:
            continue
        k = que.pop()
li = list(que)
print(''.join(li))

Submission status: Wrong Answer

Solution code:
s=list(input())
l=[]
for i in range(len(s)):
            if i ==len(s)-1:
                        if s[i]!='B':
                                    l.append(s[i])
            else:
                        if s[i] !='B':
                                    l.append(s[i])
                                    if s[i+1]=='B':
                                                del l[-1]
print("".join(l))

Submission status: Wrong Answer

Solution code:
s = list(input())

s.reverse()

print(''.join(s))

b = 0
ans = ''
for c in s:
    if c == 'B':
        b += 1
    else:
        if b > 0:
            b -= 1
            continue
        else:
            ans += c

ans = list(ans)
ans.reverse()
print(''.join(ans))

Submission status: Wrong Answer

Solution code:
S = list(input())
stack = []
stack.append(S.pop(0))

for s in S:
    if s == "B":
        if len(stack) > 0:
            stack.pop()
    else:
        stack.append(s)

print("".join(stack))

Submission status: Wrong Answer

Solution code:
s = list(input())
S = []
for i in range(len(s)-1):
    if s[i]!='B' and s[i+1]!='B':
        S.append(s[i])
if s[len(s)-1]!='B':
    S.append(s[len(s)-1])
print(''.join(S))

Submission status: Wrong Answer

Solution code:
s = input()
n = int(len(s))
word = "a"
for i in range(n):
	if s[i] == '0':
		word = word + "0"
	if s[i] == '1':
		word = word + "1"
	if s[i] == 'B':
		if int(len(s)) > 1:
			word = word[:-1]
		else:
			word = word
            
w = word[1:]
print(w)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(len(s))
word = "a"
for i in range(n):
	if s[i] == '0':
		word = word + "0"
	if s[i] == '1':
		word = word + "1"
	if s[i] == 'B':
		if int(len(s)) >= 2:
			word = word[:-1]
		else:
			word = word
word = word[1:]
print(word)

Submission status: Wrong Answer

Solution code:
s = input()
n = int(len(s))
word = "a"
for i in range(n):
	if s[i] == '0':
		word = word + "0"
	if s[i] == '1':
		word = word + "1"
	if s[i] == 'B':
		if int(len(s)) >= 2:
			word = word[:-1]
		else:
			continue
            
word = word[1:]
print(word)

Submission status: Wrong Answer

Solution code:
li = list(input())
ans = ""
for i in range(len(li)):
  if li[i] == 0:
    ans = ans + "0"
  elif li[i] == 1:
    ans = ans + "1"
  elif li[i] == "B":
    ans = ans[:len(ans)-1]
print(ans)

Submission status: Wrong Answer

Solution code:
li = list(str(input()))
for i in range(len(li)):
  if(li[i] == "B" and not i == 0):
    li[i-1] = ""
    li[i] = ""
  elif(li[i] == "B" and i == 0):
    li[0] = ""
print("".join(li))

Submission status: Wrong Answer

Solution code:
li = list(str(input()))
for i in range(len(li)):
  if(li[i] == "B" and not i == 0):
    li[i-1] = ""
    li[i] = ""
  elif(li[i] == "B" and i == 0):
    li[i] = ""
print("".join(li))

Submission status: Wrong Answer

Solution code:
li = list(str(input()))
for i in range(len(li)):
  if(li[i] == "B" and not i == 0):
    li[i-1] = ""
    li[i] = ""
print("".join(li))

Submission status: Wrong Answer

Solution code:
s=input()

ans=[]

for i in range(len(s)):
    if s[i]=='1':
        ans.append('1')
    if s[i]=='0':
        ans.append('0')
    if s[i]=='B':
        ans = ans[:-1]
print(*ans)

Submission status: Wrong Answer

Solution code:
import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7


s = input()
stack = list()
for c in s:
    if c == 'B' and len(stack) > 0:
        stack.pop()
    else:
        stack.append(c)
print(''.join(stack))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    s = input()
    ans = []
    for c in s:
        if c == '0':
            ans.insert(0, '0')
        elif c == '1':
            ans.insert(0, '1')
        elif c == 'B':
            del ans[0:1]
    ans = ''.join(ans)
    print(ans)

Submission status: Wrong Answer

Solution code:
inp=input()
ans=[]
for i in range(len(inp)):
    if inp[i]=='0' or inp[i]=='1':
        ans.append(inp[i])
    else:
        try:
            del ans[i-1]
        except:
            pass
            
print("".join(ans))

Submission status: Wrong Answer

Solution code:
s=list(input())

for i in range(len(s)-1):
    if s[i+1]=='B':
        s[i]='#'
        s[i+1]='#'

print(''.join([i for i in s if i != '#']))

Submission status: Wrong Answer

Solution code:
li = list(input())
for i in range(len(li)):
  if li[i]=="B": li[i-1]==""
else:
  for j in range(len(li)):
    if li[j]=="B": li[j]==""
  else:
    print("".join(li))

Submission status: Wrong Answer

Solution code:
s = input()
ans = []
ans_2 = ""
for i in range(len(s)):
  if s[i] == "0":
    ans.append("0")
  elif s[i] == "1":
    ans.append("1")
  elif s[i] == "B":
    if len(ans) == 0:
      continue
    else:
      ans.remove(ans[len(ans)-1])
for i in range(len(ans)):
  ans_2 += str(ans[i])
print(ans_2)

Submission status: Wrong Answer

Solution code:
t=""
for i in input():
    if i=="B":
        t=t[:-1]
    else:
        t+=i
    print(t)

Submission status: Wrong Answer

Solution code:
def main():
  s = input()
  ans = ''
  for i, sv in enumerate(list(s)):
    if sv == 'B':
      ans = ans[:i-1]
    else:
      ans += sv
  print(ans)

def input_list():
  return map(int, input().split())

import math
main()

Submission status: Wrong Answer

Solution code:
s = input()
t = ''
for x in s:
  if x == 'B' and len(t) > 0:
    t = t[:-1]
  else:
    t = t + x
print(t)

Submission status: Wrong Answer

Solution code:
s = input()
t = ''
for x in s:
  if x == 'B' and len(t) > 0:
    t = t[:-1]
  else:
    t = t + x

Submission status: Wrong Answer

Solution code:
s = list(input())

S = []
for i in s:
    if i == 'B':
        if S != []:
            S.pop(-1)
        else:
            pass
    else:
        S.append(i)
S_s = ''
for i in S:
    S_s += i
    
print(i)

Submission status: Wrong Answer

Solution code:
keys = input()
r = ''
for k in keys:
  if k == 0:
    r += '0'
  elif k == '1':
    r += '1'
  elif k == 'B':
    r = r[:len(r)-1]
print(r)

Submission status: Wrong Answer

Solution code:
keys = input()
r = ''
for k in keys:
  if k == 0:
    r += '0'
  elif k == '1':
    r += '1'
  elif k == 'b':
    r = r[:len(r)-1]
print(r)

Submission status: Wrong Answer

Solution code:
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()

print(C)

Submission status: Wrong Answer

Solution code:
given = [x for x in input()]
rets  = ''
for i, v in  enumerate(given):
    if v in ["1", "0"]:
        rets += v
    elif v == "B" and len(rets) > 0:
        rets = rets[:-1]
    else:
        rets += v
print(rets)

Submission status: Wrong Answer

Solution code:
given = [x for x in input()]
rets  = ''
for i, v in  enumerate(given):
    if v == "B" and i != 0:
        rets = rets[:-1]
    else:
        rets += v
print(rets)

Submission status: Wrong Answer

Solution code:
s=input()
s=s.replace("1B","")
s=s.replace("0B","")
s=s.replace("B","")
print(s)

Submission status: Wrong Answer

Solution code:
s=input()
print(s.replace("1B","").replace("0B","").replace("B",""))

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(10):
    s = s.replace('0B','').replace('1B','')
print(s)

Submission status: Wrong Answer

Solution code:
s=input()
lis=[]
for i in range(len(s)):
    if s[i]=='0': lis.append('0')
    elif s[i]=='1': lis.append('1')
    elif s[i]=='B' and len(lis)==0: continue
    else: lis.remove(lis[-1])
print(''.join(lis))

Submission status: Wrong Answer

Solution code:
s=input()
lis=[]
for i in range(len(s)):
    if s[i]=='0': lis.append('0')
    elif s[i]=='1': lis.append('1')
    elif s[i]=='B' and len(lis)==0: pass
    else: lis.remove(lis[-1])
print(''.join(lis))

Submission status: Wrong Answer

Solution code:
# B - バイナリハックイージー
s = input()
lst = []
for i in s:
    if i == 'B' and len(lst) !=0:
        lst.pop()
    elif i == 'B':
        continue
    else:
        lst.append(i)
print(lst)

Submission status: Wrong Answer

Solution code:
s=str(input())
while(s.count("B")!=0):
  i=s.find("B")
  print(i)
  if i!=0:
    s=s[:i-1]+s[i+1:]
  else:
    s=s[1:]
print(s)

Submission status: Wrong Answer

Solution code:
s = input()
b = 0
for i in range(len(s)-1,-1,-1):
  if s[i] == 'B':
    b += 1
  else:
    if b > 0:
      b -= 1
    else:
      print(s[i], end='')
print()

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("0B","").replace("1B","")
if  "B" in a:
    a=a.replace("0B","").replace("1B","").replace("B","")
    print(a)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("0B","")
a=a.replace("1B","")
if  "B" in a:
    a=a.replace("0B","")
    a=a.replace("1B","")
    a=a.replace("B","")
    print(a)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("0B","")
a=a.replace("1B","")
if  "B" in a:
    a=a.replace("0B","")
    a=a.replace("1B","")
    a=a.strip("B")
    print(a)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("0B","")
a=a.replace("1B","")
if  a.find("B"):
    a=a.replace("0B","")
    a=a.replace("1B","")
    if a.find("B"):
        a=a.replace("B","")
        print(a)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
a = input()
a=a.replace("0B","")
a=a.replace("1B","")
if  a.find("B"):
    a=a.replace("0B","")
    a=a.replace("1B","")
    if a.find("B"):
        a=a.replace("B","")
        print(a)
else:
    print(a)

Submission status: Wrong Answer

Solution code:
s= input()
 
list=[]
for i in s:
  if i == '0':
    list.append('0')
  elif i == '1':
    list.append('1')
  elif i == 'B':
    if len(list) != 0:
      list.pop(-1)
print(list)

Submission status: Wrong Answer

Solution code:
import re
print(re.sub(".?B", "", input()))

Submission status: Wrong Answer

Solution code:
stack = []
for s in '01B0':
    if s == '0' or s == '1':
        stack.append(s)
    if s == 'B':
        stack.pop()
print(''.join(stack))

Submission status: Wrong Answer

Solution code:
a=list(input())
for i in range(len(a)):
    if a[i]=="B" and i>=1 and len(a)!=0 :
         a[i-1]=''
         a[i]=''
if a[0]=="B":
    a[0]=''
a=''.join(a)
print(a)

Submission status: Wrong Answer

Solution code:
a=list(input())
for i in range(len(a)):
    if a[i]=="B" and i>=1 and len(a)!=0 :
         a[i-1]=''
         a[i]=''
a=''.join(a)
print(a)

Submission status: Wrong Answer

Solution code:
a=list(input())
for i in a:
       if i=='B':
        a.pop(a.index('B')-1)
        a.pop(a.index('B'))
a="".join(a)
print(a)

Submission status: Wrong Answer

Solution code:
s = input()

result = ''
for i in s:
  if (i == 'B'):
    if len(result) == 0:
      continue
    else:
      result = result[:-1]
      print(result)
  else:
    result = result + i

print(result)

Submission status: Wrong Answer

Solution code:
s = input()
a = []

for i in range(len(s)):
    if (s[i] == "B"):
        if(len(a) == 0):
            continue
        else:
            a.remove(a[len(a)-1])
    else:
        a.append(s[i])
print(''.join(a))

Submission status: Wrong Answer

Solution code:
s=input()
ans = []
for i in range(len(s)):
    ans.append(s[i])
j=1
while True:
    if ans[0]=="B":
        ans.pop(0)
    elif j>=len(ans):
        break
    elif ans[j]=="B":
        ans.pop(j-1)
        ans.pop(j-1)
    else:
        j+=1
print(*ans,sep="")

Submission status: Wrong Answer

Solution code:
s=input()
kouho = []
ans = [s[i] for i in range(len(s))]
for i in range(len(s)):
    if s[i] == "B" and i>=1:
        kouho.append(i-1)
kouho.sort()
kouho.reverse()
for j in kouho:
    ans.pop(j)
kesu = []
for k in range(len(ans)):
    if ans[k]=="B":
        kesu.append(k)
kesu.sort()
kesu.reverse()
for m in kesu:
    ans.pop(m)
print(*ans,sep="")

Submission status: Wrong Answer

Solution code:
t = ""
s = input()
for i in s:
  if len(t) == 0:
    continue
  elif i == 'B' and len(t) > 0:
    t = t[:-1]
  else:
    t += i
print(t)

Submission status: Wrong Answer

Solution code:
t = ""
s = input()
for i in s:
  if i == 'B' and len(t) > 0:
    t = t[:-1]
  else:
    t += i
print(t)