TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
My Favorite One-Liners: Python Edition
5 points
by
mr_o47
over 1 year ago
1 comment
gus_massa
over 1 year ago
> <i>Check if a List Contains All Elements of Another List:</i><p>> <i>contains_all = all(elem in list1 for elem in list2)</i><p>Isn't that quadratic? Can't it be implemented in linear (or NlogN) time using sets?