It turns out that you could avoid the #downcase with string.count("xX") == string.count("oO")
string.count("xX") == string.count("oO")
I don't know whether the performance would be significantly different, though it would avoid creating a couple of extra string instances.
There are some other interesting variations for #count, such as using it to count lower case letters with "abGvf".count("a-z")
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.