Files
30-seconds-of-code/test/difference_by/difference_by.py
Rohit Tanwar 385bf72a3e readme-script
2018-02-20 22:42:11 +05:30

3 lines
105 B
Python

def difference_by(a, b, fn):
b = set(map(fn, b))
return [item for item in a if fn(item) not in b]