char* longestCommonPrefix(char** strs, int strsSize) {
if(strsSize == 0)
return "";
int i, j;
char *out = strs[0];
for(i = 1; i < strsSize; ++i)
{
j = 0;
while(out[j] && strs[i][j] && out[j] == strs[i][j])
++j;
out[j] = 0;
}
return out;
}
if(strsSize == 0)
return "";
int i, j;
char *out = strs[0];
for(i = 1; i < strsSize; ++i)
{
j = 0;
while(out[j] && strs[i][j] && out[j] == strs[i][j])
++j;
out[j] = 0;
}
return out;
}