Problem · Graph
Nearby Fulfillment Centers with Inventory
Problem statement
A delivery must be fulfilled near a destination center. The fulfillment network is an undirected graph whose edges are given by connections. Each row [u, v] connects centers u and v in both directions.
The problem statement continues
ProExamples
Example 1
connections = [[1,2],[1,3],[2,4],[3,4],[4,5]]destination = 4maxStep = 1inventory = [[1,2],[2,0],[3,5],[4,3],[5,6]]return = [3,5]Centers 2, 3, and 5 are one edge from destination 4. Center 2 has no inventory, while centers 3 and 5 have positive inventory. The destination itself is excluded.
FastPrep Pro
Reported in 1 Amazon interview this weekUnlock this recently reported problem
FastPrep Pro gives you full access to interview problems reported within the last week.
- Full problem statement and constraints
- 2 more worked examples, explained
- Guided hints and editorial
- Run your code on real test cases
$9/month
Pro subscription, billed yearly — or $19 month-to-month. Cancel anytime.
Free plan — 2 of 2 free unlocks used this week