C (gcc), 121 113 bytes
i;d;f(s)char**s;{char**_=s,x[255]={0},y[99]={0};for(d=0,i=0;*_;++_)d+=x[y[i++]=*(*_)++]++;d=d?*x?0:f(s):puts(y);}
Ungolfed
void enklactify(char *strings[]) {
int quit = 0;
while (!quit) {
char **arg = strings; // current row
int exists[255] = {0}; // which characters exist in the column
char output[99] = {0}; // will hold output string
int index = 0; // where to insert in output
int duplicates = 0; // have we found any duplicates?
while (*arg != NULL) {
char *word = *arg; // current word
char first = *word; // first letter of current word
if (exists[first])
duplicates = 1; // we found a duplicate
exists[first] = 1; // mark it as in our string
output[index] = first; // add it to our output
index++;
(*arg)++; // advances the current word to the next
// character by reference (chops first char)
arg++; // advance to next whole argument
}
if (!duplicates) { // This is a valid solution
puts(output);
quit = 1;
}
if (exists[0]) { // We hit the null terminator of one of the
// input strings, so we failed
quit = 1;
}
}
}
This abuses the ability to just add 1 to a string pointer in C to get the 'tail' of the string. The main byte savers are:
d+=x[y[i++]=*(*_)++]++
which appends the first character of the first string of_
toy
, advances the first string of_
to remove its first character, adds thex
entry at that character tod
, and increments saidx
entryq=d?*x:puts(y)
which printsy
ifd
is non-zero while settingq
to a non-zero value, or setsq
to non-zero if the first element ofx
is non-zero (if we were at the end of one of the strings then said element would be non-zero)
Edit: Shaved bytes by switching from while loop to recursive tail call and removing brackets from for loop.