WorldQuant Interview Question

Heap log aggregation question in Python.