- 문자열의 순서를 유지하면서 절반을 날려야하기 때문에, 0은 앞에서부터 제거하고 1은 뒤에서 부터 제거해줌.
- 총 제거 횟수는 count 함수를 통해 찾아냈으며, pop(index)를 활용하여 해당 자리의 숫자를 제거함.
def solution() :
n = list(input())
zero = n.count('0') // 2
one = n.count('1') // 2
for _ in range(zero) :
n.pop(-(n[::-1].index('0'))-1)
for _ in range(one) :
n.pop(n.index('1'))
print(''.join(n))
solution()