You are viewing a single comment's thread. Return to all comments →
def findMedian(a): # Write your code here m=0 a.sort() f=[] l=[] le=len(a) if le%2!=0: m=le//2 return a[m] elif le%2==0: t=le//2 f=a[:t] l=a[t:] return (f[-1]+l[0])/2
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Median
You are viewing a single comment's thread. Return to all comments →