Buggy python submission (verdict: Time Limit Exceeded):
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
for _ in range(int(l/2)):
    l = len(S_list)
    if l<2:
        break
    check_dif = False
    for i in range(l-1):
        if S_list[i] != S_list[i+1]:
            S_list.pop(i)
            S_list.pop(i)
            check_dif = True
            break
    if check_dif:
        ans+=2
    else:
        break
print(ans)

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
while True:
    l = len(S_list)
    if l<2:
        break
    check_dif = False
    for i in range(l-1):
        if S_list[i] != S_list[i+1]:
            S_list.pop(i)
            S_list.pop(i)
            check_dif = True
            break
    if check_dif:
        ans+=2
print(ans)

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    for i in range(l-1):
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            check_dif = True
            ans += pickup(S,ans)
            break
    if check_dif:
        ans+=2
    return ans   
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    for i in range(l-1):
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            ans += pickup(S,ans)
            return ans+2
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    check_dif = False
    #print(S)
    for i in range(l-1):
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            #print(S)
            check_dif = True
            ans += pickup(S,ans)
            break
    if check_dif:
        ans+=2
    return ans   
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    check_dif = False
    #print(S)
    for i in range(l-1):
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            #print(S)
            check_dif = True
            ans += pickup(S,ans)
            break
    if not check_dif:
        return ans
    else:
        return ans+2
    
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    check_dif = False
    #print(S)
    for i in range(l-1):
        if i+1
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            #print(S)
            check_dif = True
            ans += pickup(S,ans)
            break
    if not check_dif:
        return ans
    else:
        return ans+2
    
S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)

Buggy python submission (verdict: Runtime Error):
def pickup(S,ans):
    l = len(S)
    if l<2:
        return ans
    check_dif = False
    #print(S)
    for i in range(l-1):
        if S[i] != S[i+1]:
            S.pop(i)
            S.pop(i)
            #print(S)
            check_dif = True
            ans += pickup(S,ans)
            break
    if not check_dif:
        return ans
    else:
        return ans+2
    
S=input()
S_list = []
l = len(S)
for i in range(l):
    S_list.append(S[i])
ans =0
print(pickup(S_list,ans))

Fixed submission:
S=input()
num_one=S.count('1')
num_zero=S.count('0')
ans = 2*min(num_one,num_zero)
print(ans)