Algorithm · Microsoft · Easy
Examples On the input line the first number is the window width W and the remaining numbers are the event timestamps. Each output line is one nonempty bucket, written as min_ts max_ts. Example 1 With W = 1, the events 0.2 and 0.9 share bucket [0, 1), 1.5 is alone in [1, 2), and 2.3 is alone in [2, 3). Example 2 With W = 2, 0.0 and 1.0 fall in [0, 2) while 2.0 and 3.5 fall in [2, 4). Requirements A stream supplies events as floating-point timestamps. Partition these events…
Checking your access…