Task: | Järjestys |
Sender: | Kirill_Akimov |
Submission time: | 2022-01-22 13:46:26 +0200 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.08 s | details |
Code
t = int(input()) for _ in range(t): a = bytearray(str(input()), 'ascii') l = len(a) n = a.count(65) if 2*n >= l: answer = a[n:].count(65) else: answer = a[:n].count(66) print(answer)