From f2c236bb9e5c1e3d69833bfa31e0ff3c49d008a0 Mon Sep 17 00:00:00 2001 From: lone-wolf05 <143163978+shubhangdutta96@users.noreply.github.com> Date: Fri, 13 Sep 2024 00:08:18 +0530 Subject: [PATCH] Count the Number of Consistent Strings.java Daily LeetCode Challenge --- ...ount the Number of Consistent Strings.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 java/Count the Number of Consistent Strings.java diff --git a/java/Count the Number of Consistent Strings.java b/java/Count the Number of Consistent Strings.java new file mode 100644 index 000000000..cc40b86d1 --- /dev/null +++ b/java/Count the Number of Consistent Strings.java @@ -0,0 +1,24 @@ +class Solution { + public int countConsistentStrings(String allowed, String[] words) { + Set allow = new HashSet<>(); + int count = 0; + + for(int i=0; i