JavaScript Regex solution


  • 0
    B
    var findTheDifference = function(s, t) {
        var rex = s.split("");
        
        for(var i = 0; i < rex.length; i++){
            t = t.replace(rex[i], '');
        }
        return t;
    };
    

Log in to reply
 

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