Balanced X and O

Imagine you need to check whether two symbols are balanced in a string, for a simple game or pattern check. Write a function xo that counts the letters x and o without caring about letter case. Return True if the counts are equal, otherwise return False.

Примеры

Ввод
"xo"
Вывод
True
Ввод
"xxOo"
Вывод
True
Ввод
"xxxm"
Вывод
False

Нужно реализовать

def xo(s: str) -> bool:

Теги

strings
PostgreSQLv16

Tukaj bo rezultat izvajanja kode

Visible tests
1
Input
"xo"
ExpectedTrue
2
Input
"xxOo"
ExpectedTrue
3
Input
"xxxm"
ExpectedFalse
4
Input
"ooom"
ExpectedFalse
5
Input
"zzzz"
ExpectedTrue
6
Input
" "
ExpectedTrue
Focus radio
Paused · SomaFM · Fluid