We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
below code is giving runtime error?
def countTriplets(arr, r):
my_list = []
for i in arr:
my_list.append(int(math.log(i,r)))
comb = list(combinations(my_list,3))
counter = 0
for i in comb:
if (i[0]==i[1]-1==i[2]-2):
counter += 1
return counter
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Count Triplets
You are viewing a single comment's thread. Return to all comments →
below code is giving runtime error? def countTriplets(arr, r):