571. Find the Median for Each Company (Hard)