Wrong Answer
Code
def count_swaps(s):
zeros = 0
ones = 0
for c in s:
if c == '0':
zeros += 1
ones += 1
return min(zeros, ones)
t = int(input())
for _ in range(t):
n = int(input())
s = input()
print(count_swaps(s))
Information
- Submit By
- Type
- Submission
- Problem
- P1016 Swap sort
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-01-07 14:44:42
- Judged At
- 2024-11-11 03:43:43
- Judged By
- Score
- 0
- Total Time
- 22ms
- Peak Memory
- 3.312 MiB