Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int solution(String typedText) {
- int upperSum = 0;
- int lowerSum = 0;
- for (char ch : typedText.toCharArray()) {
- if (Character.isUpperCase(ch)) {
- upperSum ++;
- } else if (Character.isLowerCase(ch)) {
- lowerSum ++;
- }
- }
- return upperSum - lowerSum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement