char ** findWords(char ** words, int wordsSize, int* returnSize){ char* symbol[] = {"123456789","qwertyuiop","asdfghjkl","zxcvbnm"}; char** arr = (char**)malloc(wordsSize*sizeof(char*)); int i,j,k,pst,n=0; for (i=0; i<wordsSize; i++) { pst=0; for (j=0; j<strlen(words[i]); j++) { if (pst) { if (!strchr(symbol[pst],tolower(words[i][j]))) break; } else { for (k=1; k<=3; k++) if (strchr(symbol[k],tolower(words[i][j]))) pst=k; } } if (j == strlen(words[i])) arr[n++] = words[i]; } *returnSize=n; return arr; }