C++ solution easy understand


  • 0
    W
    class Solution {
    public:
        bool isAnagram(string s, string t) {
            std::sort(s.begin(), s.end());
            std::sort(t.begin(), t.end());
            if (t == s)
                return true;
            else
                return false;
        }
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.