You are viewing a single comment's thread. Return to all comments →
def beautifulTriplets(d, arr): c=0 n=len(arr) for i in range(n): for j in range(i+1,n): if arr[j]-arr[i]==d: for k in range(j+1,n): if arr[k]-arr[j]==d: c+=1 return c
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 →