countCapitals 🌶️
Write a method countCapitals that takes a String s and returns how many of its characters are capital letters (A to Z). Digits, spaces, punctuation and lowercase letters do not count.
For example, countCapitals("Hello World") is 2, and countCapitals("abc") is 0.
Characters compare by their code. Write the test for "is a capital letter" with two comparisons.
Does your test count A and Z themselves?