LeetCode – Valid Anagram (Java)
Given two strings s and t, write a function to determine if t is an anagram of s. Java Solution 1 Assuming the string contains only lowercase alphabets, here is a simple solution. public boolean isAnagram(String s, String t) { if(s==null || t==null) return false; if(s.length()!=t.length()) return false; int[] arr = new int[26]; … Read more