Fastest way to filter when right hand sinde of `in` is large

Use a set instead of an array for the right hand side.
Membership check in a set scales with O(1), whereas an array it scales with O(n).

7 Likes