• + 0 comments
    def beautifulTriplets(d, arr):
        return sum(1 for n in arr if n+d in arr and n+(2*d) in arr)