Buggy python submission (verdict: Time Limit Exceeded):
#120 C
S =input()
min_=min(S.count('0'),S.count('1'))
cnt=0
for i in range(min_):
    if S.count('01')>0:
        S=S.replace('01','',1)
        cnt+=2
    if  S.count('10')>0:
        S=S.replace('10','',1)
        cnt+=2
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
#120 C
S =input()
cnt=0
for i in range(len(S)):
    if S.count('01')>0:
        S=S.replace('01','',1)
        cnt+=2
    if  S.count('10')>0:
        S=S.replace('10','',1)
        cnt+=2
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())
cnt=0
while '10' in s or '01' in s:
    cnt+=s.count('10')
    s=s.replace('10', '') 
    cnt+=s.count('01')
    s=s.replace('01', '') 
print(cnt*2)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
import re
s = str(input())
cnt=0
while '10' in s or '01' in s:
    cnt+=s.count('10')
    s=re.sub('10', '',s) 
    cnt+=s.count('01')
    s=re.sub('01', '',s) 

print(cnt*2)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
import re
s = str(input())
cnt=0
while len(s) >1:
    if '10' in s:
        cnt+=2 * s.count('10')
        s=re.sub('10', '',s) 
        cnt+=2 * s.count('01')
        s=re.sub('01', '',s) 
        
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=re.sub('01', '',s) 
        
        cnt+=2 * s.count('10')
        s=re.sub('10', '',s) 
    else:
        break
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = str(input())

cnt=0

for i in range(len(s)//2):
    if '10' in s:
        cnt+=2 * s.count('10')
        s=s.replace('10', '') 
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=s.replace('01', '') 
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt=0
 
for i in range(len(s)//2):
    if '10' in s:
        cnt+=2 * s.count('10')
        s=s.replace('10', '') 
    elif '01' in s:
        cnt+=2 * s.count('01')
        s=s.replace('01', '') 
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt=0

for i in range(len(s)//2):
    try: 
        if '10' in s:
            cnt+=2 * s.count('10')
            s=s.replace('10', '') 
    except:
        pass
    try: 
        if '01' in s:
            cnt+=2 * s.count('01')
            s=s.replace('01', '') 
    except:
        pass
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt=0
while True:
    for i in range(len(s)//2):
        try: 
            if '10' in s:
                cnt+=2 * s.count('10')
                s=s.replace('10', '') 
        except:
            pass
        try: 
            if '01' in s:
                cnt+=2 * s.count('01')
                s=s.replace('01', '') 
        except:
            pass
    break
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt=0
while True:
    for i in range(len(s)//2):
        try: 
            if '10' in s:
                s=s.replace('10', '',1) 
                cnt+=2
        except:
            pass
        try: 
            if '01' in s:
                s=s.replace('01', '',1) 
                cnt+=2
        except:
            pass
    break
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)

Buggy python submission (verdict: Time Limit Exceeded):
s = input()
cnt=0
while True:
    for i in range(len(s)):
        try: 
            if '10' in s:
                s=s.replace('10', '',1) 
                cnt+=2
        except:
            pass
        try: 
            if '01' in s:
                s=s.replace('01', '',1) 
                cnt+=2
        except:
            pass

    break
print(cnt)

Fixed submission:
#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)