How do you calculate the max # of sales in a 5 day period?

if you have an array of daily sales, you can each_cons over it:

http://stdlib.rubyonrails.org/libdoc/enumerator/rdoc/index.html