from Hacker News

My Favorite One-Liners: Python Edition

by mr_o47 on 11/20/23, 10:39 AM with 1 comments

  • by gus_massa on 11/23/23, 8:22 PM

    > Check if a List Contains All Elements of Another List:

    > contains_all = all(elem in list1 for elem in list2)

    Isn't that quadratic? Can't it be implemented in linear (or NlogN) time using sets?