Codele / Algorithms

Sliding window

Which 3 days in a row sold the most? Instead of adding up every group from scratch, slide a frame along the row: add the day that comes in, drop the day that leaves.

Loading the playable lesson…