public class Solution {
public boolean isAnagram(String s, String t) {
if (s == null || t == null) return false;
int len1 = s.length();
int len2 = t.length();
if (len1 != len2) return false;
int[] vector = new int[26];
for (int i = 0; i < len1; i++) {
vector[s.charAt(i) - 'a']++;
vector[t.charAt(i) - 'a']--;
}
for (int i : vector) {
if(i != 0) {
return false;
}
}
return true;
}
}