Minimum Distinct Distribution Centers

Asked at Amazon · Coding Questions · Difficulty: Medium

Hubs are labelled `1..n`. For each day the chosen hub compares to the previous day: if today's demand is higher it must be a **larger** hub number, if lower a **smaller** one, if equal the **same** hub. Given `daily_trend`, return the minimum number of distinct hub labels needed.

Loading the problem…