def well(x):
n = 0
for j in x:
for i in j:
if str(i).lower() == 'good':
n += 1
if n == 1 or n == 2:
return 'Publish!'
elif n > 2:
return 'I smell a series!'
return 'Fail!'
def well(x):
# 0.05ms
a = [i for i in x if i == 'good']
if 3 > len(a) > 0:
return 'Publish!'
elif len(a) > 2:
return 'I smell a series!'
return 'Fail!'
from collections import Counter
def well2(x):
# 0.19ms
c = Counter(x)
if 3 > c['good'] > 0:
return 'Publish!'
elif c['good'] > 2:
return 'I smell a series!'
return 'Fail!'
def well3(x):
# 0.11 ms
countOfGoodIdeas = 0
for i in x:
if i == 'good':
countOfGoodIdeas+=1
if 3 > countOfGoodIdeas > 0:
return 'Publish!'
elif countOfGoodIdeas > 2:
return 'I smell a series!'
return 'Fail!'