Stones are placed at distinct integer points of a 2D plane, given as stones[i] = [row, col]. A stone may be removed if there is another stone still on the board in the same row or the same column. Return the largest number of stones that can be removed.
- A
DSU class with find(x), union(a, b) (returns false when they were already together), setSize(x) and a components counter is already provided - The coordinates are not small enough to build a grid from; think about rows and columns as elements
- One stone, or stones that share nothing, give
0 - Up to 1000 stones