Checkpoint: Running average
Challenge on lesson: Checkpoint: One Transform, Whole Answer
CHALLENGE
Difficulty: intermediate+25 XP
Implement std::vector<double> running_avg(const std::vector<int>& v) where element i is the average of v[0..i]. One std::transform with a by-reference captured prefix sum must produce the whole output (no manual loop in main). The empty vector returns an empty vector.
Press Submit to check your solution.
Back to lesson: Checkpoint: One Transform, Whole Answer