Median Updates Hackerrank Solution For Python