Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
lambda + set solution in Clear category for Striped Words by kdim
def checkio(line: str) -> str:
v, c, mt = set('aeiouy'), set('bcdfghjklmnpqrstvwxz'), str.maketrans(',.?', ' ')
l = line.translate(mt).lower()
alter = lambda x: (set(x[::2]) <= v and set(x[1::2]) <= c) or (set(x[::2]) <= c and set(x[1::2]) <= v)
return len([i for i in l.split() if alter(i) and len(i) > 1])
Jan. 27, 2021
Comments: