public class Solution { public string[] FindWords(string[] words) { string firstRow = "qwertyuiop"; string secondRow = "asdfghjkl"; string thirdRow = "zxcvbnm"; List<string> result = new List<string>( ); foreach (string word in words) { bool[] holdFirst = new bool[word.Length]; bool[] holdSecond = new bool[word.Length]; bool[] holdThird= new bool[word.Length]; for (int i = 0; i < word.Length; i++) { holdFirst[i] = firstRow.Contains( word.ToLower()[i] ); holdSecond[i] = secondRow.Contains( word.ToLower()[i] ); holdThird[i] = thirdRow.Contains( word.ToLower()[i] ); } var inFirstRow = holdFirst.ToList( ).All( x => x == true ); var inSecondRow = holdSecond.ToList( ).All( x => x == true ); var inThirdRow = holdThird.ToList( ).All( x => x == true ); if (inFirstRow) result.Add( word ); if (inSecondRow) result.Add( word ); if (inThirdRow) result.Add( word ); } return result.ToArray(); }