Medium data structure and algorithm practice puzzle.
Given a distribution tree and a starting TTL, return how many nodes receive the packet. Every hop decrements the TTL and a packet is dropped when it hits zero, so the source at depth 0 is reached when the TTL is at least 1 and nothing below depth TTL is reached at all. This is a depth-limited walk, and the TTL exists for exactly the reason the previous puzzle does: it is what stops a loop from being forever.
Solve it three ways: snap the jigsaw pieces together, fill in the blanks, or type it from scratch against the tests. This one is free.
Browse all 536 puzzles