Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def strings(count):
- for _ in range(count):
- yield "aba"
- def match_ends(words):
- return len( [word for word in words if len(word)>=2 and word[0] == word[-1] ] )
- match_ends2 = lambda ws: sum(len(w) >= 2 and w[0] == w[-1] for w in ws)
- print(match_ends(strings(10 ** 9)))
Advertisement
Add Comment
Please, Sign In to add comment