Accepted C# Solution (5 lines)


  • -1
    M

    public bool IsAnagram(string s, string t) {
    char[] src = s.ToCharArray();
    char[] des = t.ToCharArray();
    Array.Sort<char>(src);
    Array.Sort<char>(des);
    return (src.SequenceEqual<char>(des));
    }


  • 0
    K

    Maybe it is better to make a On answer.


Log in to reply
 

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