Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Most Stones Removed With Same Row or Column

Stones lie at distinct integer coordinates. A stone can be removed if another stone shares its row or column. Print the maximum number of stones that can be removed.

Constraints

1 <= n <= 1000 0 <= x, y <= 10^4

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.