From dc00895c737079d9d6ee9487dcd264a84af3e98e Mon Sep 17 00:00:00 2001 From: josdem Date: Thu, 11 Apr 2024 09:51:15 -0400 Subject: [PATCH] Adding solution --- .../src/main/java/com/josdem/kata/UppercaseCounter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java b/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java index d07c29c..0fa5d1c 100644 --- a/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java +++ b/simple-algorithms/counting-uppercase/src/main/java/com/josdem/kata/UppercaseCounter.java @@ -3,10 +3,10 @@ public class UppercaseCounter { public int count(String message) { - return message.length(); + return message.chars().filter(Character::isUpperCase).toArray().length; } public boolean hasSpace(String message) { - return message.isEmpty(); + return message.contains(" "); } }