FaireSoftware Engineer · OnsiteCodemia practiceCompute the Best Active Brand Promotion Timeline Across Overlapping Campaigns
A brand can run many overlapping wholesale promotions, each with a start day, an exclusive end day, a discount percent and an id. Return the timeline as maximal non-overlapping segments (start, end, percent, promo_id) showing which promotion gives the retailer the best discount at every moment, skipping gaps with no active promotion.