Easy Understanding || 100% Faster Solution || Two Approaches || Hashing || Sorting
First Solution using Hashing.\nTime Complexity O(n)\nSpace Complexity O(n)\n\n\nclass Solution {\npublic:\n    bool isAnagram(string s, string t) \n    {\n\t\t/
First Solution using Hashing.\nTime Complexity O(n)\nSpace Complexity O(n)\n\n```\nclass Solution {\npublic:\n    bool isAnagram(string s, string t) \n    {\n\t\t// If size is not equal we can declare straight away, that its not an anagram.\n        if (s.size() != t.size())\n            return false;\n        unordered_map<char, int> mp1, mp2;\n\t\t// Count number of character occurs in both the strings.\n        for (char c: s)\n            mp1[c]++;\n        for (char c: t)\n            mp2[c]++;\n\t\t// If occurrance of each character is same in both the strings, then the string is anagram.\n        for (int i = 0; i < s.size(); i++)\n            if (mp1[s[i]] != mp2[s[i]])\n                return false;\n        return true;\n    }\n};\n```\nSecond Solution Using Sorting.\nTime Complexity O(n*log(n))\nSpace Complexity O(1).\n```\nclass Solution {\npublic:\n    bool isAnagram(string s, string t) \n    {\n\t\t// If size is not equal we can declare straight away, that its not an anagram.\n        if (s.size() != t.size())\n            return false;\n        sort(s.begin(), s.end());\n        sort(t.begin(), t.end());\n        return (s == t);\n    }\n};\n```
['String', 'C', 'Sorting', 'C++']