[Solved] Find how many instances of a word can be made from the chars in a string [closed]

[ad_1]

string = "casortdhgeujcode"
key = "code"
frequency = {}

for c in key:
    frequency[c] = string.count(c)
    
print(min(frequency.values()))
    

13

[ad_2]

solved Find how many instances of a word can be made from the chars in a string [closed]