-
Hello, I'm working through the Codility problems, and ran into your solution to MinAvgTwoSlice, which is absolutely brilliant. :-) Are there any resources/publications on the internet that explain this methodology, or did you come up with it yourself? Thank you, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello, You are very complimentary. I had to re-read the whole thing since it has been a while. I mentioned in the notes that I googled for discussion of the mathematics around averages and, given the mention of graphs and visualizations of moving averages, I expect the solution was a straightforward step from there (the observation of averages of 2 and 3 item sequences versus averages of sequences of 4 or more items). I like to think, had I encountered a resource/publication on this specific problem, I would have referenced it at the time; but it sounds like I just researched "moving averages" generally and took it from there. Note that all those solutions were completed without time pressure and that is my biggest struggle with such tests; maybe I can solve them eventually, but rarely within the time constraints. Perhaps that is a fair reflection in that, in the real world, my managers are never happy with how much time it takes me to implement solutions; but I never get complaints about the quality of the solution; sadly they don't put any value on quality unless it breaks. Thanks. |
Beta Was this translation helpful? Give feedback.
Hello,
You are very complimentary. I had to re-read the whole thing since it has been a while. I mentioned in the notes that I googled for discussion of the mathematics around averages and, given the mention of graphs and visualizations of moving averages, I expect the solution was a straightforward step from there (the observation of averages of 2 and 3 item sequences versus averages of sequences of 4 or more items). I like to think, had I encountered a resource/publication on this specific problem, I would have referenced it at the time; but it sounds like I just researched "moving averages" generally and took it from there.
Note that all those solutions were completed without time pres…