My simple Javascript solution


  • 0
    K
    var isAnagram = function(s, t) {
    
    if(!s && !t)return true;
    var sa=s.split("");
    var ta=t.split("");
    s=sa.sort().join("");
    t=ta.sort().join("");
    if(s.localeCompare(t)=== 0)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.