Back to problems

Solve Nearby Inventory and Word Segmentation Tasks

Algorithm · Amazon · Hard

Implement two independent functions. Part A selects stock-holding centers that are close enough to a graph destination. Part B splits a lowercase string into dictionary words. Part A — Eligible Inventory Centers Consider an undirected graph in which vertices are inventory centers and edges are delivery routes. The graph is supplied as connections, a list of two-element edges [u, v]. You are also given a destination center, a nonnegative max_step, and an inventory map from…

Checking your access…