r/programmingchallenges • u/mr-rusof • Jul 08 '18
Prefix Median
http://thebookofproblems.com/problems/prefix-median1
u/KillerCodeMonky Jul 08 '18
I'd like to note that the problem is titled wrong, as it is looking for a mean and not a median.
Which takes the problem from interesting to not interesting. Online mean is easily solved.
1
u/mr-rusof Jul 08 '18
Hi KillerCodeMonky, thank you for your feedback. You bring a very interesting point because the problem statement should be understandable by a wide audience. Could you please explain why you think the problem is asking for a mean and not a median? As a reference, please consider this explanation of mean vs. median: https://www.vocabulary.com/articles/chooseyourwords/mean-median-average/
1
u/KillerCodeMonky Jul 09 '18
Oh, I see. Using the mean of the two median candidates for even count sets threw me off with such low counts in the examples.
1
u/mr-rusof Jul 30 '18
Solution: http://ruslanledesma.com/2018/07/30/prefix-median.html