// Title  : keyboar-row
// Date   : 2017-03-10
// Author : Daguo
/*****************************************

*****************************************/

/**
 * @param {string[]} words
 * @return {string[]}
 */
var findWords = function(words) {
    var firstRow = ['q','w','e','r','t','y','u','i','o','p'];
    var secondRow = ['a','s','d','f','g','h','j','k','l'];
    var thirdRow = ['z','x','c','v','b','n','m'];
    words.forEach((v,index)=>{
        var arr = v.split('');
        var n = arr[0].toLocaleLowerCase();
        var row = null;
        if(firstRow.indexOf(n) !== -1){
            row = firstRow;
        }else if(secondRow.indexOf(n) !== -1){
            row = secondRow;
        }else{
            row = thirdRow;
        }
        for(var i=1;i<arr.length;i++){
            if(row.indexOf(arr[i].toLocaleLowerCase()) == -1){
       		 	return words.splice(index,1);
            }
        }
    })
    return words;
};
module.exports = findWords;

@@ -101,16 +101,376 @@
 *******%0A
+Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.%0A%0AExample 1:%0AInput: %5B%22Hello%22, %22Alaska%22, %22Dad%22, %22Peace%22%5D%0AOutput: %5B%22Alaska%22, %22Dad%22%5D%0ANote:%0AYou may use one character in the keyboard more than once.%0AYou may assume the input string will only contain letters of alphabet.
 %0A*******
@@ -764,24 +764,25 @@
 ','n','m'%5D;%0A
+%0A
     words.fo
@@ -1291,16 +1291,17 @@
 rds;%0A%7D;%0A
+%0A
 module.e

add 500