You are viewing a single comment's thread. Return to all comments →
from functools import reduce
def average(array): st = set(array) sm = reduce(lambda x,y: x+y, list(st)) return sm/len(st)
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.
Introduction to Sets
You are viewing a single comment's thread. Return to all comments →
from functools import reduce
def average(array): st = set(array) sm = reduce(lambda x,y: x+y, list(st))
return sm/len(st)