Most Stones Removed with Same Row or Column

Most Stones Removed with Same Row or Column

You are given n stones on a 2D plane. The i-th stone is located at (x_i, y_i). No two stones occupy the same coordinate.

In one operation, you may...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: