Back to problems

Equalize Server Latency

Algorithm · ByteDance · Hard

Minimum Additional Latency Medium · Topics · Company Tags · Hints A group of n servers is numbered from 0 to n - 1 and organized as a perfect binary tree. Server 0 is the root, and every other server has a parent at index floor((i - 1) / 2). The children of server i, when they exist, are located at 2 * i + 1 and 2 * i + 2. A child exists only if its index is strictly less than n. The tree structure is perfect: all internal servers have two children, and every leaf is on the…

Checking your access…