Algorithm · OpenAI · Hard
You are building a message-driven protocol for a distributed system represented by a rooted n-ary tree. Every machine is modeled as a node with a unique string identifier ranging from 0 to n - 1. A node records its parent identifier (-1 for the root) and the identifiers of all its children. A node may exchange messages only with its direct parent or direct children through the supplied messaging API, and messages can travel in both directions. The system must support these…
Checking your access…