Given two strings s and t, return true if t is an anagram of s, and false otherwise.

An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

&nbsp;
Example 1:
Input: s = "anagram", t = "nagaram"
Output: true
Example 2:
Input: s = "rat", t = "car"
Output: false

&nbsp;
Constraints:


	1 &lt;= s.length, t.length &lt;= 5 * 104
	s and t consist of lowercase English letters.


&nbsp;
Follow up: What if the inputs contain Unicode characters? How would you adapt your solution to such a case?

class Solution:
    def isAnagram(self, s: str, t: str) -> bool:
        return Counter(s) == Counter(t)
class Solution {
    public boolean isAnagram(String s, String t) {
        if (s.length() != t.length()) return false;
        int[] haha1 = new int[26];//26 because input contains of only lower english letters
        int[] haha2 = new int[26];
        for (int i = 0; i < s.length(); ++i) {
            haha1[(int)s.charAt(i)-97] += 1;//omitting 97 because 'a' is 97, it will be 0 now
            haha2[(int)t.charAt(i)-97] += 1;
        }
        for (int i = 0; i < haha1.length; ++i) {
            if (haha1[i] != haha2[i]) return false;
        }
        return true;
    }
}
class Solution {
public:
    bool isAnagram(string s, string t) {
        sort(s.begin(), s.end());
        sort(t.begin(), t.end());

        if(s != t)
            return false;

        return true;
    }
};
var isAnagram = function(s, t) {
    if(s.length !== t.length) return false
    
    let charFreq = {}
    
    for(let char of s){
        charFreq[char] ? charFreq[char] +=1 : charFreq[char] = 1
    }
    
    for(let char of t){
        if(!(charFreq[char])) return false
        charFreq[char] -= 1
    }
    return true
};
Valid Anagram