Input: s = "anagram", t = "nagaram"
Output: true
Input: s = "rat", t = "car"
Output: false
#include <algorithm>
class Solution
{
public:
bool isAnagram(string s, string t)
{
std::sort(s.begin(), s.end());
std::sort(t.begin(), t.end());
return s == t;
}
};