Most Server Racks Removed Through Shared Channels

A server room stores equipment in racks placed on integer grid coordinates. The rack at stones[i] = [row_i, column_i] shares a communication channel with every rack in the same row or the same column.

You may remove a rack only when another rack still present shares its row or column. Remove as many racks as possible, and return the maximum number removed.

The remaining racks do not need to be connected to one another. Treat each rack as a distinct position, and assume no two racks occupy the same coordinate.

Examples
Input: [[0,0],[0,1]]
Output: 1
Hints

Most Server Racks Removed Through Shared Channels

A server room stores equipment in racks placed on integer grid coordinates. The rack at `stones[i] = [row_i, column_i]` shares a communication channel with every rack in the same row or the same column.