diff --git a/Valid_anagram.java b/Valid_anagram.java new file mode 100644 index 0000000..c16acc4 --- /dev/null +++ b/Valid_anagram.java @@ -0,0 +1,28 @@ +class Solution { + public boolean isAnagram(String s, String t) { + int n=s.length(); + if(t.length()!=n)return false; + HashMap hs=new HashMap<>(); + for(int i=0;i map : hs.entrySet()){ + int i=map.getValue(); + if(i>0)return false; + } + return true; + } +}