You are viewing a single comment's thread. Return to all comments →
The second set() is redundant if you use the (arguably more readable) intersection function instead:
len(set(a).intersection(x+k for x in a))
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
The second set() is redundant if you use the (arguably more readable) intersection function instead: