diff --git a/solution.java b/solution.java new file mode 100644 index 0000000..56fa699 --- /dev/null +++ b/solution.java @@ -0,0 +1,25 @@ +class Solution { + public boolean wordPattern(String pattern, String s) { + + String[] arr= s.split(" "); + HashMap map = new HashMap<>(); + + if(arr.length!= pattern.length()) + return false; + + for(int i = 0; i