Maximum Haul Without Linked Neighbors: Line, Ring and Tree
Asked at D. E. Shaw · Coding Questions · Difficulty: Medium · Last asked Nov 23, 2026
A collector visits a set of sites, each holding some value, and wants the largest total. Two sites that are directly linked share an alarm, so the collector may never take from both of them. You solve this for three layouts of the sites: a straight line, a ring, and a binary tree. Each layout is one function.
Loading the problem…