You are viewing a single comment's thread. Return to all comments →
def beautifulTriplets(d, arr): count = 0 set_of_numbers = set(arr) for n in arr: fir = n sec = fir + d thi = sec + d if sec in set_of_numbers and thi in set_of_numbers: count += 1 return count
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 →