Javascript Solution


  • 0
    D

    Javascript solution:

    /**
     * @param {string} s
     * @return {boolean}
     */
    var isPalindrome = function(s) {
        s = s.toLowerCase().replace(/[^a-z0-9]+/g, "").split("");
        return s.toString() === s.reverse().toString();
    };
    

Log in to reply
 

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