<commit_before><commit_msg>Q242 Valid Anagram<commit_after>public class Solution {
    public boolean isAnagram(String s, String t) {
        if(s.length() != t.length()){
            return false;
        }
        HashMap<Character, Integer> map1 = new HashMap<Character, Integer>();

        for(int i = 0; i < s.length(); i++){
            if(map1.containsKey(s.charAt(i))){
                map1.put(s.charAt(i), map1.get(s.charAt(i)) + 1);
            }else{
                map1.put(s.charAt(i), 1);
            }
        }
        for(int i = 0; i < t.length(); i ++){
            if(map1.containsKey(t.charAt(i))){
                if(map1.get(t.charAt(i)) > 1){
                    map1.put(t.charAt(i), map1.get(t.charAt(i)) - 1);
                }else{
                    map1.remove(t.charAt(i));
                }
            }else{
                return false;
            }
        }
        for(int i = 0; i < s.length(); i ++){
            if(map1.get(s.charAt(i)) != null){
                return false;
            }
        }
        return true;
    }
}
{'fraction_non_alphanumeric': 0.16, 'fraction_numerical': 0.01953488372093023, 'mean_word_length': 1.3189655172413792, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3790254', 'n_tokens_mistral': 369, 'n_tokens_neox': 350, 'n_words': 63}