My Javascript Solution

  • 0

    Hi Guys,

    Please let me know if anyone has a comment on that code :

    var isAnagram = function(s, t) {

    if(s.length !== t.length)
        return false;
        s = s.split('').sort();
        t = t.split('').sort();
    for( var i = 0; i < s.length; i++ ){
        if(s[i] != t[i])
            return false;
    return true;


Log in to reply

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