Available question text
Given n stones on integer coordinates where a stone can be removed if it shares a row or column with another, compute the maximum number removable. Key insight: build a graph connecting stones that share a row/column, find its connected components (via DFS/Union-Find), and the answer is n minus the number of components.
Related questions
Continue with questions that share topics or the same question type.
- The first was leetcode Set Matrix Zeroes.
The LeetCode problem Set Matrix Zeroes is a classic 2D array manipulation problem. The description is as follows:
You are given an
𝑚
×
𝑛
m×n matrix of integers. If any element is 0, you must set its entire row and column to 0. In other words, for each cell that contains 0, all cells in the same row and column should be changed to 0.
Coding
- Check if Every Row and Column Contains All Numbers
Coding
- Difference Between Ones and Zeros in Row and Column
Coding
- Equal Row and Column Pairs
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Leetcode 947. Most Stones Removed with Same Row or Column
Reported Nov 12, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source