JavaScript Solution


  • 0
    J
    /**
     * @param {string[]} words
     * @return {string[]}
     */
    var findWords = function(words) {
      return words = words.filter(word => {
        return word.toLowerCase().match(/[asdfghjkl]+|[qwertyuiop]+|[zxcvbnm]+/)[0] == word.toLowerCase();
      });
    };
    

Log in to reply
 

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