int maxNumberOfBalloons(char * text){ int i=0,len=strlen(text),hash[50]={0},min=10000; char* s = "balon"; for(; i<len; i++) hash[text[i]-'a']++; for (i=0; i<5; i++) { if (s[i] == 'l' || s[i] == 'o') if (hash[s[i]-'a']/2 < min) min = hash[s[i]-'a']/2; else if (hash[s[i]-'a'] < min) min = hash[s[i]-'a']; } return min; }