You are viewing a single comment's thread. Return to all comments →
def beautifulTriplets(d, arr): return sum(1 for n in arr if n+d in arr and n+(2*d) in arr)
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Triplets
You are viewing a single comment's thread. Return to all comments →