You are viewing a single comment's thread. Return to all comments →
This is the simple approach in the python language
l=len(arr) count=0 for i in range(l-2): if arr[i]+d in arr and arr[i]+(2*d) in arr: count+=1 return count
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Beautiful Triplets
You are viewing a single comment's thread. Return to all comments →
This is the simple approach in the python language