Algorithm · Uber · Medium
Problem Statement You are given an array balls where each element balls[i] = [x_i, y_i] gives the coordinates of a ball on a 2D plane. Two balls are considered connected if they share the same row (identical y-coordinate) or the same column (identical x-coordinate), and the distance between them along that shared axis is no more than d. The distance is simply the absolute difference of the coordinates along the axis they share. You may perform a removal operation: pick any…
Checking your access…