s=input()
d={}
for i in s:
if i==βCβ:
if d.get(i)==None:
d[i]=1
else:
d[i]+=1
if d.get(βCβ)!=None:
if d.get(i)==None:
d[i]=1
else:
if d[i]<d[βCβ]:
d[i]+=1
print(min(d.values()))
i dont know where my code is failing.`s=input()
d={}
for i in s:
if i==βCβ:
if d.get(i)==None:
d[i]=1
else:
d[i]+=1
if d.get(βCβ)!=None:
if d.get(i)==None:
d[i]=1
else:
if d[i]<d[βCβ]:
d[i]+=1
print(d)
print(min(d.values()))
the route in chef is C > H > E > F
you are always chking possibility of route directly from
C to E in 1st else if block | correct
C to H in 2nd else if block | incorrect , change it
C to F in 3nd else if block | incorrect , change it
ONLY THESE MINUTE CHANGES AND YOUR CODE WILL BE PERFECT FOR ALL TEST DATA
My code is pretty much equivalent to yours, and I get a WA (Wrong Answer) when I submit it. I canβt figure out which string would give me a wrong answer. Did you ever figure out what is wrong with yours?