text made of English letters. Call a letter two-faced if it appears in text both in lowercase and in uppercase (for example, both q and Q).
Return the number of distinct two-faced letters.text="BoatbOAt" → 3
b, o and a appear both in lowercase and in uppercase, while t is only lowercase. The answer is 3.
text="HELLO" → 0
There are no lowercase letters at all, so the answer is 0.
text="xYyX" → 2
text consists only of lowercase and uppercase English letterstext="BoatbOAt"
3
Run checks the first 3 tests in your browser. Submit checks all 104 tests on the server, hidden ones included.