Back to problems

Find Maximum Chain Activations

Algorithm · ByteDance · Medium

Given an array devices, where each element is a triple [x, y, r], each device is located at coordinates (x, y) and has an activation radius r. A device i can directly trigger a device j exactly when: $$ \sqrt{(x_i - x_j)^2 + (y_i - y_j)^2} \le r_i $$ Activation is one-way: i may be able to trigger j even when j cannot trigger i. If one device is manually powered on first, every device that can be reached from it through a chain of direct triggers also becomes powered on. The…

Checking your access…