char * shortestCompletingWord(char * licensePlate, char ** words, int wordsSize){
char* s = (char *)calloc(strlen(licensePlate),sizeof(char));
int i,j;
int n=0;
int pst = -1;
int len = 16;
int flag = true;
for (i=0; i<strlen(licensePlate); i++)
{
if (licensePlate[i]>='a' && licensePlate[i]<='z') s[n++] = licensePlate[i];
else if(licensePlate[i]>='A' && licensePlate[i]<='Z') s[n++] = licensePlate[i] + 32;
}
for (i=0; i<wordsSize; i++)
{
if (strlen(words[i]) >= len) continue;
int* hash = (int *)calloc(26,sizeof(int));
for (j=0; j<strlen(words[i]); j++)
{
hash[words[i][j] - 97]++;
}
for (j=0; j<n; j++)
{
hash[s[j]-97]--;
if (hash[s[j]-97]<0)
{
flag = false;
break;
}
}
if(flag)
{
pst = i;
len = strlen(words[i]);
}
flag = true;
}
return words[pst];
}