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.
this my solution but after the 2 case not working with more data :c help
defrunningMedian(a):# Write your code hereres=[]temp=[]count=0fornumberina:temp.append(number)temp=sorted(temp)size=len(temp)middle=round(size/2)impar=(size%2)if(impar==1):currentSize=size-1middleImpar=round(currentSize/2)median=temp[middleImpar]res.append(float(median))else:median=(temp[middle-1]+temp[middle])/2res.append(float(median))returnres
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Find the Running Median
You are viewing a single comment's thread. Return to all comments →
this my solution but after the 2 case not working with more data :c help