int canConstruct(char *ransomNote, char *magazine)
{
int dict[26] = {0};
if(ransomNote[0] == '\0')
return 1;
int i = 0;
while(magazine[i] != '\0')
{
dict[magazine[i++]-'a']++;
}
i = 0;
while(ransomNote[i] != '\0')
{
if(--dict[ransomNote[i++]-'a'] < 0)
return 0;
}
return 1;
}