Day 40: Counting Ones
Given a stream of zeroes and ones, the goal today is to count number of ones in an arbitrarily large window.
That is surprisingly difficult problem. If there are 10⁹ elements in a day and you are queried for the past 6 months, you can’t just keep all the stream in…