So the basic ideas are: ( 1) create an array that has columns of offer amount according to offer dates, and set them to 0, (2) loop over the dates (i.e., dates as index of the array) and fill in the offer amount of correspondence dates, 3) calculate the dates interval, which is 7 days, and find out the offer amount occurred in the time interval, and keep comparing all of the offer amount until the max amount is found, and then fill in the correspondence date. These are very advanced logic and technique, thanks a lot for reply, Kurt_Bremser! It's good learning experience for me and helps me understand how to improve my code and thinking!
... View more