You are viewing a single comment's thread. Return to all comments →
Would this be faster?
a=set(a) return sum(x+k in a for x in a)
Also, you don't need the brackets - you can do a set comprehension instead of a converting a list comprehension
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 →
Would this be faster?
Also, you don't need the brackets - you can do a set comprehension instead of a converting a list comprehension