Max is not like sum, you can just maintain one value over the window and update from new ones arriving immediately?
The whole point of the post is that this is easy to implement for sum, but is difficult for max. Posting how someone solves the problem for sum isn't really addressing anything new here.