Loading...
Loading...
Loading...
A café owner wants to know how often one letter shows up in a customer review. Read the review and a letter, and print how many times that letter appears. Capital and small forms count as the same letter.
Example 1
Input
Excellent service e
Output
5
E, e, e in "Excellent" and e, e in "service".
Example 2
Input
Banana A
Output
3
The letter is given in capital, but small a counts too.
Try the problem first. Open one hint at a time.
Change both the review and the letter to lowercase so you only compare small letters.
Take the letter as a char with charAt(0), then loop over the review and count matches.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor