List list = new ArrayList(0);
for (...)
{
list.add(...);
}
..[] = list.toArray(...);

class Solution {
public String[] findWords(String[] words) {
String s1 = "qwertyuiopQWERTYUIOP";
String s2 = "asdfghjklASDFGHJKL";
String s3 = "zxcvbnmZXCVBNM";
List<String> list = new ArrayList<>();
for(String word : words ){
int len = word.length();
int n1 = 0, n2 = 0, n3 = 0;
for(int i = 0; i < len; i++){
if(s1.contains(word.charAt(i)+"")) n1++;
else if(s2.contains(word.charAt(i)+"")) n2++;
else n3++;
}
if(n1 == len || n2 == len || n3 == len) list.add(word);
}
return list.toArray(new String[list.size()]);
}
}